Метаданные в PostgreSQL, байты в приватном bucket; sync upload 201 ready; компенсация orphan и cmd/reconcile с dry-run/apply и grace period.
25 lines
888 B
Docker
25 lines
888 B
Docker
# syntax=docker/dockerfile:1.7
|
|
FROM golang:1.24.2-bookworm AS build
|
|
WORKDIR /src
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
COPY cmd ./cmd
|
|
COPY internal ./internal
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/server ./cmd/server
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/reconcile ./cmd/reconcile
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/s3bootstrap ./cmd/s3bootstrap
|
|
|
|
FROM gcr.io/distroless/static-debian12:nonroot
|
|
COPY --from=build /out/server /server
|
|
COPY --from=build /out/reconcile /reconcile
|
|
COPY --from=build /out/s3bootstrap /s3bootstrap
|
|
USER nonroot:nonroot
|
|
EXPOSE 8080
|
|
ENV APP_HOST=0.0.0.0 \
|
|
APP_PORT=8080 \
|
|
APP_ENV=lab \
|
|
SESSION_TTL_SECONDS=3600
|
|
HEALTHCHECK --interval=5s --timeout=3s --start-period=15s --retries=5 \
|
|
CMD ["/server", "-healthcheck"]
|
|
ENTRYPOINT ["/server"]
|