From 912472d8bad4b04ae090c3c09ad25f979fb75343 Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Wed, 26 Mar 2025 22:11:37 -0700 Subject: [PATCH] add Dockerfile, compose.yaml --- Dockerfile | 12 ++++++++++++ compose.yaml | 6 ++++++ 2 files changed, 18 insertions(+) create mode 100644 Dockerfile create mode 100644 compose.yaml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..86a78c1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM golang:1.23 AS builder +WORKDIR /app +COPY go.mod go.sum ./ +RUN go mod download +COPY . . +RUN CGO_ENABLED=0 GOOS=linux go build -o /app/plcwatch +FROM alpine:latest +RUN apk --no-cache add ca-certificates +RUN adduser -D appuser +USER appuser +COPY --from=builder /app/plcwatch /plcwatch +ENTRYPOINT ["/plcwatch"] diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..0473147 --- /dev/null +++ b/compose.yaml @@ -0,0 +1,6 @@ +services: + app: + container_name: plcwatch + build: + context: . + dockerfile: ./Dockerfile -- 2.51.2