Реализовать lab3 на оценку 4: балансировка и отказ API

This commit is contained in:
Daria0w0
2026-10-23 17:14:32 +03:00
parent 0ab3a341aa
commit a67e7996ec
88 changed files with 5105 additions and 21 deletions
+33
View File
@@ -0,0 +1,33 @@
FROM golang:1.26.3 AS build
WORKDIR /src
ENV GOTOOLCHAIN=local
ENV CGO_ENABLED=0
COPY go.mod go.sum ./
RUN go mod download
COPY cmd ./cmd
COPY internal ./internal
RUN go vet ./... \
&& go test ./... \
&& go build -trimpath -ldflags="-s -w" -o /out/server ./cmd/server
FROM scratch
COPY --from=build /out/server /server
USER 65532:65532
ENV APP_HOST=0.0.0.0
ENV APP_PORT=8080
EXPOSE 8080
STOPSIGNAL SIGTERM
HEALTHCHECK --interval=5s --timeout=3s --start-period=5s --retries=3 \
CMD ["/server", "healthcheck"]
ENTRYPOINT ["/server"]