Files
mtusi2026lab2/compose.yaml
T

52 lines
1.1 KiB
YAML

name: mtusi-messenger-lab2
services:
postgres:
image: postgres:17.6-alpine3.22
container_name: mtusi-lab2-postgres
environment:
POSTGRES_DB: messenger
POSTGRES_USER: messenger
POSTGRES_PASSWORD_FILE: /run/secrets/db_password
secrets:
- db_password
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U messenger -d messenger"]
interval: 5s
timeout: 3s
retries: 10
start_period: 10s
restart: unless-stopped
api:
build: .
image: mtusi-messenger:lab2
container_name: mtusi-lab2-api
depends_on:
postgres:
condition: service_healthy
environment:
APP_HOST: "0.0.0.0"
APP_PORT: "8080"
DB_HOST: postgres
DB_PORT: "5432"
DB_NAME: messenger
DB_USER: messenger
DB_PASSWORD_FILE: /run/secrets/db_password
SESSION_TTL_SECONDS: ${SESSION_TTL_SECONDS:-3600}
secrets:
- db_password
ports:
- "127.0.0.1:8080:8080"
restart: unless-stopped
secrets:
db_password:
file: ./secrets/db_password
volumes:
postgres-data: