feat(app) lab2 prepared for mr

This commit is contained in:
imadev
2026-10-23 18:55:20 +03:00
parent 1db3953226
commit f6e74247fd
57 changed files with 2367 additions and 660 deletions
+20
View File
@@ -0,0 +1,20 @@
# syntax=docker/dockerfile:1.7
# AGENT: Two-stage build. The final image contains only the static binary and a
# CA bundle, runs as a non-root user and keeps the server as PID 1 for signals.
FROM golang:1.27.1-alpine AS build
WORKDIR /src
COPY app/go.mod app/go.sum ./
RUN go mod download
COPY app/ ./
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/server ./cmd/server
FROM alpine:3.22
RUN addgroup -S -g 10001 app && adduser -S -u 10001 -G app app
COPY --from=build /out/server /usr/local/bin/server
USER app
EXPOSE 8080
ENTRYPOINT ["/usr/local/bin/server"]