Files
BountyBoard/Dockerfile
T
etalon 976f5238f8 feat: scaffold app skeleton with config, ULID, health endpoints, compose stack (phase 1)
- internal .env loader (real env wins) + strictly validated config struct
- ULID package: 48-bit ms timestamp + 80-bit crypto randomness, sortable
- HTTP server with recovery/request-id/trusted-proxy/access-log middleware
- /healthz, /readyz (pluggable checkers), /metricsz (counter registry)
- multi-stage Dockerfile (alpine, non-root) + compose with healthchecks,
  app bound to 127.0.0.1:8787, mongo unpublished, graceful 15s shutdown

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 18:10:30 +02:00

19 lines
497 B
Docker

# --- build stage ---
FROM golang:1.26-alpine AS build
WORKDIR /src
COPY go.* ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/app ./cmd/app
# --- runtime stage ---
FROM alpine:3.21
RUN apk add --no-cache ca-certificates && \
addgroup -S app && adduser -S -G app app
USER app
WORKDIR /srv
COPY --from=build /out/app /usr/local/bin/app
EXPOSE 8787
# busybox wget ships with alpine; used by the compose healthcheck
ENTRYPOINT ["/usr/local/bin/app"]