lab2: postgresql, redis sessions, grade 4 completed

This commit is contained in:
Your Name
2026-11-02 21:29:07 +03:00
parent 65003b6119
commit e67d13cf3d
9 changed files with 570 additions and 27 deletions
+40
View File
@@ -0,0 +1,40 @@
services:
db:
image: postgres:15-alpine
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: messenger
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U user -d messenger"]
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
command: redis-server --appendonly yes
volumes:
- redisdata:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
api:
build: .
ports:
- "8080:8080"
env_file: .env
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
volumes:
pgdata:
redisdata: