feat: implement lab3 load balancing and idempotency

This commit is contained in:
Fedoroff
2026-10-27 20:34:22 +03:00
parent 0ab3a341aa
commit 35ae6f722e
43 changed files with 3045 additions and 42 deletions
+32
View File
@@ -0,0 +1,32 @@
FROM golang:1.25.0-alpine3.22 AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY cmd ./cmd
COPY internal ./internal
COPY migrations ./migrations
RUN CGO_ENABLED=0 GOOS=linux go build \
-trimpath \
-ldflags="-s -w" \
-o /server ./cmd/server
FROM alpine:3.22.1
RUN apk add --no-cache ca-certificates \
&& addgroup -S app \
&& adduser -S -G app app
WORKDIR /app
COPY --from=builder /server /app/server
USER app
EXPOSE 8080
CMD ["/app/server"]