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