#docker-compose.yml services: postgres: image: postgres:16-alpine container_name: privascan-postgres environment: POSTGRES_DB: privascan POSTGRES_USER: privascan POSTGRES_PASSWORD: privascan ports: - "5432:5432" volumes: - postgres_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U privascan"] interval: 5s timeout: 5s retries: 5 redis: image: redis:7-alpine container_name: privascan-redis ports: - "6379:6379" volumes: - redis_data:/data healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 5s timeout: 3s retries: 5 api: build: . container_name: privascan-api command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload ports: - "8000:8000" env_file: .env environment: DATABASE_URL: postgresql+asyncpg://privascan:privascan@postgres:5432/privascan REDIS_URL: redis://redis:6379/0 CELERY_BROKER_URL: redis://redis:6379/0 CELERY_RESULT_BACKEND: redis://redis:6379/1 volumes: - ./app:/app/app depends_on: postgres: condition: service_healthy redis: condition: service_healthy healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8000/api/v1/health"] interval: 10s timeout: 5s retries: 5 worker: build: . container_name: privascan-worker command: celery -A app.workers.celery_app worker --loglevel=info --concurrency=2 env_file: .env environment: DATABASE_URL: postgresql+asyncpg://privascan:privascan@postgres:5432/privascan REDIS_URL: redis://redis:6379/0 CELERY_BROKER_URL: redis://redis:6379/0 CELERY_RESULT_BACKEND: redis://redis:6379/1 volumes: - ./app:/app/app depends_on: postgres: condition: service_healthy redis: condition: service_healthy beat: build: . container_name: privascan-beat command: celery -A app.workers.scheduler beat --loglevel=info env_file: .env environment: DATABASE_URL: postgresql+asyncpg://privascan:privascan@postgres:5432/privascan REDIS_URL: redis://redis:6379/0 CELERY_BROKER_URL: redis://redis:6379/0 CELERY_RESULT_BACKEND: redis://redis:6379/1 volumes: - ./app:/app/app depends_on: - redis bot: build: . container_name: privascan-bot command: python -m app.bot.telegram_bot env_file: .env environment: DATABASE_URL: postgresql+asyncpg://privascan:privascan@postgres:5432/privascan REDIS_URL: redis://redis:6379/0 volumes: - ./app:/app/app depends_on: postgres: condition: service_healthy redis: condition: service_healthy volumes: postgres_data: redis_data: