name: mtusi-lab2 services: db: image: postgres:17.6-alpine 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: 2s timeout: 3s retries: 30 api: image: mtusi-messenger:lab2 build: . environment: APP_HOST: ${APP_HOST:-0.0.0.0} APP_PORT: 8080 APP_ENV: ${APP_ENV:-lab} SESSION_TTL_SECONDS: ${SESSION_TTL_SECONDS:-3600} DATABASE_URL_FILE: /run/secrets/database_url SESSION_STORE: postgres secrets: - database_url ports: - "127.0.0.1:${APP_PORT:-8080}:8080" depends_on: db: condition: service_healthy healthcheck: test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:8080/health/ready').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"] interval: 3s timeout: 5s retries: 30 volumes: pgdata: secrets: postgres_password: file: ./secrets/postgres_password database_url: file: ./secrets/database_url