name: mtusi-lab2-kraykin x-postgres: &postgres image: postgres:17.6-alpine environment: POSTGRES_DB: messenger POSTGRES_USER: messenger POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password secrets: [postgres_password] healthcheck: test: [CMD-SHELL, 'pg_isready -U messenger -d messenger'] interval: 2s timeout: 2s retries: 20 cpus: 2 mem_limit: 512m shm_size: 128m stop_grace_period: 10s services: postgres: <<: *postgres volumes: [postgres_data:/var/lib/postgresql/data] valkey: image: valkey/valkey:8.1.3-alpine command: [valkey-server, /run/secrets/valkey_config] secrets: [valkey_config] volumes: [valkey_data:/data] cpus: 1 mem_limit: 128m stop_grace_period: 5s api: image: mtusi-messenger:lab2 build: . environment: APP_HOST: 0.0.0.0 APP_PORT: 8080 APP_ENV: lab SESSION_TTL_SECONDS: ${SESSION_TTL_SECONDS:-3600} SESSION_STORE: postgres DATABASE_URL_FILE: /run/secrets/database_url CACHE_URL_FILE: /run/secrets/cache_url CURSOR_KEY_FILE: /run/secrets/cursor_key secrets: [database_url, cache_url, cursor_key] ports: ['127.0.0.1:${APP_PORT:-8080}:8080'] depends_on: postgres: condition: service_healthy valkey: condition: service_started cpus: 2 mem_limit: 512m stop_grace_period: 7s tests: profiles: [verify] build: context: . target: tests environment: DATABASE_TEST_URL_FILE: /run/secrets/database_url secrets: [database_url] depends_on: postgres: condition: service_healthy research-db: <<: *postgres profiles: [research] volumes: [research_data:/var/lib/postgresql/data] restore-db: <<: *postgres profiles: [research] volumes: [restore_data:/var/lib/postgresql/data] secrets: postgres_password: file: ./secrets/postgres_password database_url: file: ./secrets/database_url cache_url: file: ./secrets/cache_url valkey_config: file: ./secrets/valkey_config cursor_key: file: ./secrets/cursor_key volumes: postgres_data: valkey_data: research_data: restore_data: