feat: add PostgreSQL persistence and sessions

This commit is contained in:
2026-09-24 10:14:44 +03:00
parent 65003b6119
commit 25722c5f60
32 changed files with 2641 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
FROM golang:1.26.5-alpine3.24 AS build
WORKDIR /src
COPY . .
RUN go build ./cmd/messenger
FROM build AS test
CMD ["go", "test", "./internal/postgres", "./internal/session"]
FROM build AS experiment
CMD ["go", "run", "./cmd/lab2experiment"]
FROM alpine:3.24.2
RUN addgroup -S app && adduser -S -G app -u 10001 app
COPY --from=build --chown=app:app /src/messenger /app/messenger
USER app
WORKDIR /app
HEALTHCHECK --interval=10s --timeout=2s --start-period=5s --retries=3 \
CMD wget -q -O /dev/null "http://127.0.0.1:${APP_PORT}/health/ready" || exit 1
CMD ["/app/messenger"]