chore(app) transferred codebase from Lab2

This commit is contained in:
imadev
2026-10-26 19:40:35 +03:00
parent 0ab3a341aa
commit f731f9b460
45 changed files with 2653 additions and 13 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"]