Перенос минимума из lab2

This commit is contained in:
2026-11-05 18:00:36 +03:00
parent 0ab3a341aa
commit 4303783848
24 changed files with 3359 additions and 8 deletions
+22
View File
@@ -0,0 +1,22 @@
FROM golang:1.26-bookworm AS build
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY messenger ./messenger
COPY internal ./internal
COPY migrations ./migrations
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
go build -trimpath -ldflags='-s -w' -o /out/messenger ./messenger \
&& chmod 755 /out/messenger
FROM gcr.io/distroless/static-debian12:nonroot@sha256:afa5c872c891853ca7fcf1f12c3edb23f7eeef36189728842dd51042ff57f7ab
COPY --from=build --chown=65532:65532 /out/messenger /messenger
USER 65532:65532
ENV APP_HOST=0.0.0.0 \
APP_PORT=8080 \
APP_ENV=lab \
SHUTDOWN_TIMEOUT_SECONDS=8
EXPOSE 8080
HEALTHCHECK --interval=5s --timeout=3s --start-period=15s --retries=3 \
CMD ["/messenger", "healthcheck"]
ENTRYPOINT ["/messenger"]