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: