lab4 - оценка 4

This commit is contained in:
Rakshasa2
2026-10-26 18:16:58 +03:00
parent ec540a1a72
commit aea79e8ed7
19 changed files with 2833 additions and 20 deletions
+27
View File
@@ -0,0 +1,27 @@
FROM golang:1.22-alpine AS builder
WORKDIR /build
COPY go.mod go.sum ./
RUN go mod download
COPY src/ ./src/
RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/server ./src/cmd/server
FROM alpine:3.20
RUN addgroup -S app && adduser -S -G app app
WORKDIR /app
COPY --from=builder /out/server .
USER app
EXPOSE 8080
HEALTHCHECK --interval=5s --timeout=3s --start-period=10s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:8080/health/ready || exit 1
CMD ["./server"]