services: api: build: . ports: - "8000:80" environment: # Redis configuration - REDIS_HOST=valkey - REDIS_PORT=6379 env_file: .env depends_on: - valkey restart: unless-stopped healthcheck: test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/')"] interval: 30s timeout: 10s retries: 3 start_period: 40s valkey: image: valkey/valkey:8-alpine restart: unless-stopped healthcheck: test: ["CMD", "valkey-cli", "ping"] interval: 30s timeout: 10s retries: 3 volumes: - valkey_data:/data volumes: valkey_data: