services: app: build: . ports: - "5001:5001" environment: - ENVIRONMENT=production - POSTGRES_USER=${POSTGRES_USER:-postgres} - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-postgres} - POSTGRES_DB=${POSTGRES_DB:-onchain_agent} - POSTGRES_HOST=postgres - OPENAI_API_KEY=${OPENAI_API_KEY} - CDP_API_KEY_NAME=${CDP_API_KEY_NAME} - CDP_API_KEY_PRIVATE_KEY=${CDP_API_KEY_PRIVATE_KEY} - PYTHONUNBUFFERED=1 depends_on: postgres: condition: service_healthy volumes: - ./wallet_credentials.json:/app/wallet_credentials.json - ./cdp_api_key.json:/app/cdp_api_key.json deploy: resources: limits: memory: 1G reservations: memory: 512M healthcheck: test: ["CMD", "curl", "-f", "http://localhost:5001/health"] interval: 30s timeout: 10s retries: 3 start_period: 40s logging: driver: "json-file" options: max-size: "10m" max-file: "3" restart: unless-stopped postgres: image: postgres:15 environment: - POSTGRES_USER=${POSTGRES_USER:-postgres} - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-postgres} - POSTGRES_DB=${POSTGRES_DB:-onchain_agent} ports: - "5432:5432" volumes: - postgres_data:/var/lib/postgresql/data deploy: resources: limits: memory: 512M reservations: memory: 256M healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"] interval: 5s timeout: 5s retries: 5 logging: driver: "json-file" options: max-size: "10m" max-file: "3" restart: unless-stopped volumes: postgres_data: