init commit: create skeleton from lab1

This commit is contained in:
2026-10-16 22:39:23 +03:00
parent 65003b6119
commit aecd8d2957
70 changed files with 3205 additions and 8 deletions
+55
View File
@@ -0,0 +1,55 @@
services:
postgres:
image: postgres:16.10-bookworm
restart: unless-stopped
environment:
POSTGRES_USER: messenger
POSTGRES_DB: messenger
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
secrets:
- postgres_password
volumes:
- pgdata:/var/lib/postgresql/data
ports:
- "127.0.0.1:5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U messenger -d messenger"]
interval: 5s
timeout: 3s
retries: 10
migrate:
build: .
image: mtusi-messenger:lab2
command: ["alembic", "upgrade", "head"]
env_file: .env
secrets:
- database_url
depends_on:
postgres:
condition: service_healthy
restart: "no"
api:
build: .
image: mtusi-messenger:lab2
restart: unless-stopped
env_file: .env
secrets:
- database_url
ports:
- "127.0.0.1:8080:8080"
depends_on:
postgres:
condition: service_healthy
migrate:
condition: service_completed_successfully
secrets:
postgres_password:
file: ./secrets/postgres_password
database_url:
file: ./secrets/database_url
volumes:
pgdata: