Перенес основы lab3 в lab4

This commit is contained in:
Daria0w0
2026-11-06 14:44:30 +03:00
parent ec540a1a72
commit 9197e151ba
59 changed files with 4761 additions and 3 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"]