Реализация ЛР 2 на 3

This commit is contained in:
2026-11-03 02:07:22 +03:00
parent 65003b6119
commit a3246a08f3
11 changed files with 732 additions and 0 deletions
+44
View File
@@ -0,0 +1,44 @@
name: mtusi-lab2
services:
postgres:
image: postgres:16.6-alpine
restart: unless-stopped
environment:
POSTGRES_DB: messenger
POSTGRES_USER: messenger
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
secrets:
- postgres_password
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U messenger -d messenger"]
interval: 5s
timeout: 3s
retries: 10
api:
build: .
image: mtusi-messenger:lab2
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
environment:
APP_ENV: ${APP_ENV:-lab}
SESSION_TTL_SECONDS: ${SESSION_TTL_SECONDS:-3600}
DATABASE_URL_FILE: /run/secrets/database_url
secrets:
- database_url
ports:
- "127.0.0.1:8080:8080"
secrets:
postgres_password:
file: ./secrets/postgres_password
database_url:
file: ./secrets/database_url
volumes:
pgdata: