Реализация с PostgreSQL и session-based auth

This commit is contained in:
2026-11-11 21:52:43 +03:00
parent e0195cab89
commit d96d8ecfc7
9 changed files with 681 additions and 282 deletions
+35
View File
@@ -0,0 +1,35 @@
services:
api:
build: .
ports:
- "8080:8080"
environment:
- DATABASE_URL=postgresql://messenger:messenger_pass@postgres:5432/messenger
- SESSION_TTL_SECONDS=3600
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health/ready"]
interval: 5s
timeout: 3s
retries: 5
restart: unless-stopped
postgres:
image: postgres:16.1
environment:
- POSTGRES_DB=messenger
- POSTGRES_USER=messenger
- POSTGRES_PASSWORD=messenger_pass
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U messenger"]
interval: 5s
timeout: 3s
retries: 5
restart: unless-stopped
volumes:
postgres_data: