Dockerfile 467 B

123456789101112131415161718192021222324252627282930
  1. FROM golang:1.24.5-alpine AS build
  2. WORKDIR /src
  3. COPY go.mod go.sum ./
  4. RUN go mod download
  5. COPY . .
  6. RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /out/status .
  7. FROM alpine:3.22
  8. WORKDIR /app
  9. RUN adduser -D -H -u 10001 appuser
  10. COPY --from=build /out/status /app/status
  11. COPY config.yaml /app/config.yaml
  12. COPY templates /app/templates
  13. COPY static /app/static
  14. ENV ADDR=:8080
  15. ENV CONFIG_PATH=/app/config.yaml
  16. EXPOSE 8080
  17. USER appuser
  18. CMD ["/app/status"]