feat: moved project from lab2

This commit is contained in:
TAskMAster339
2026-10-10 12:14:31 +03:00
parent 0ab3a341aa
commit a856733fe9
59 changed files with 5346 additions and 1 deletions
+39
View File
@@ -0,0 +1,39 @@
FROM golang:1.22.2-bookworm AS builder
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY backend ./backend
RUN CGO_ENABLED=0 \
GOOS=linux \
go build \
-trimpath \
-ldflags="-s -w" \
-o /out/messenger \
./backend
FROM debian:12.15-slim
RUN groupadd --system app \
&& useradd --system --gid app --no-create-home app
WORKDIR /app
COPY --from=builder /out/messenger ./messenger
ENV APP_HOST=0.0.0.0
ENV APP_PORT=8080
EXPOSE 8080
HEALTHCHECK --interval=10s --timeout=3s --start-period=5s --retries=3 \
CMD ["./messenger", "healthcheck"]
USER app:app
CMD ["./messenger"]