services: postgres_restore: image: postgres:17.6-bookworm environment: POSTGRES_DB: messenger POSTGRES_USER: messenger POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password secrets: - postgres_password volumes: - restore_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U messenger -d messenger"] interval: 2s timeout: 2s retries: 20 api_restore: build: . environment: APP_HOST: 0.0.0.0 APP_PORT: 8080 DATABASE_URL_FILE: /run/secrets/database_url_restore VALKEY_URL: redis://valkey:6379/0 secrets: - database_url_restore depends_on: postgres_restore: condition: service_healthy healthcheck: test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8080/health/ready', timeout=2).close()"] interval: 2s timeout: 3s retries: 20 start_period: 5s secrets: database_url_restore: file: ${RESTORE_DATABASE_URL_FILE:?Set by scripts/backup_restore.sh} volumes: restore_data: name: ${RESTORE_VOLUME_NAME:?Set by scripts/backup_restore.sh}