services: redis: image: redis:7-alpine ports: - "6379:6379" volumes: - redis_data:/data healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 5s timeout: 3s retries: 5 postgres: image: postgres:16-alpine ports: - "5432:5432" environment: POSTGRES_USER: trading POSTGRES_PASSWORD: trading POSTGRES_DB: trading volumes: - postgres_data:/var/lib/postgresql/data healthcheck: test: ["CMD-LINE", "pg_isready", "-U", "trading"] interval: 5s timeout: 3s retries: 5 data-collector: build: context: . dockerfile: services/data-collector/Dockerfile env_file: .env ports: - "8080:8080" depends_on: redis: condition: service_healthy postgres: condition: service_healthy healthcheck: test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8080/health')"] interval: 10s timeout: 5s retries: 3 restart: unless-stopped strategy-engine: build: context: . dockerfile: services/strategy-engine/Dockerfile env_file: .env ports: - "8081:8081" depends_on: redis: condition: service_healthy postgres: condition: service_healthy healthcheck: test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8081/health')"] interval: 10s timeout: 5s retries: 3 restart: unless-stopped order-executor: build: context: . dockerfile: services/order-executor/Dockerfile env_file: .env ports: - "8082:8082" depends_on: redis: condition: service_healthy postgres: condition: service_healthy healthcheck: test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8082/health')"] interval: 10s timeout: 5s retries: 3 restart: unless-stopped portfolio-manager: build: context: . dockerfile: services/portfolio-manager/Dockerfile env_file: .env ports: - "8083:8083" depends_on: redis: condition: service_healthy postgres: condition: service_healthy healthcheck: test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8083/health')"] interval: 10s timeout: 5s retries: 3 restart: unless-stopped prometheus: image: prom/prometheus:latest profiles: ["monitoring"] ports: - "9090:9090" volumes: - ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml depends_on: - data-collector - strategy-engine - order-executor - portfolio-manager grafana: image: grafana/grafana:latest profiles: ["monitoring"] ports: - "3000:3000" depends_on: - prometheus volumes: redis_data: postgres_data: