# Use compose file version that supports all features version: '3.9' services: postgres: image: postgres:16-alpine restart: unless-stopped environment: POSTGRES_DB: blockchain_api POSTGRES_USER: postgres POSTGRES_PASSWORD: password POSTGRES_INITDB_ARGS: "--auth-host=scram-sha-256" ports: - "5432:5432" volumes: - postgres_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 10s timeout: 5s retries: 5 start_period: 10s redis: image: redis:7-alpine restart: unless-stopped ports: - "6379:6379" volumes: - redis_data:/data command: redis-server --appendonly yes --maxmemory 512mb --maxmemory-policy allkeys-lru healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 10s timeout: 5s retries: 5 start_period: 5s app: build: context: . dockerfile: Dockerfile ports: - "8080:8080" environment: DATABASE_URL: postgresql://postgres:password@postgres:5432/blockchain_api REDIS_URL: redis://redis:6379 SERVER_HOST: 0.0.0.0 SERVER_PORT: 8080 JWT_SECRET: your-super-secret-jwt-key-change-this-in-production JWT_EXPIRATION: 86400 ETH_RPC_URL: https://eth.llamarpc.com POLYGON_RPC_URL: https://polygon.llamarpc.com BSC_RPC_URL: https://bsc-dataseed.binance.org RATE_LIMIT_PER_SECOND: 10 RATE_LIMIT_BURST: 20 RUST_LOG: info depends_on: postgres: condition: service_healthy redis: condition: service_healthy restart: unless-stopped volumes: postgres_data: redis_data: