Run the dedicated calendar worker, bind the web service to loopback port 21005, and match the host nginx upstream. Trust forwarded headers only from the Docker subnet and replace untrusted forwarded client chains at the public proxy. Validate Compose without resolving production environment files; do not restart services.
48 lines
1.0 KiB
YAML
48 lines
1.0 KiB
YAML
name: alphapulse
|
|
|
|
x-backend: &backend
|
|
build:
|
|
context: ../backend
|
|
dockerfile: ../deploy/Dockerfile.backend
|
|
image: alphapulse-backend
|
|
env_file: ../.env
|
|
restart: unless-stopped
|
|
networks: [dev_default]
|
|
|
|
services:
|
|
api:
|
|
<<: *backend
|
|
command: [uvicorn, alphapulse.api.main:app, --host, 0.0.0.0, --port, "8000", --proxy-headers, --forwarded-allow-ips, "172.18.0.0/16"]
|
|
|
|
crawler:
|
|
<<: *backend
|
|
command: [python, -m, alphapulse.crawler.manager]
|
|
# 留时间给 scrapy 子进程优雅退出并刷完日志
|
|
stop_grace_period: 30s
|
|
|
|
market:
|
|
<<: *backend
|
|
command: [python, -m, alphapulse.market.worker]
|
|
|
|
trader:
|
|
<<: *backend
|
|
command: [python, -m, alphapulse.trading.engine]
|
|
|
|
calendar:
|
|
<<: *backend
|
|
command: [python, -m, alphapulse.calendar.worker]
|
|
|
|
web:
|
|
build:
|
|
context: ../web
|
|
dockerfile: ../deploy/Dockerfile.web
|
|
restart: unless-stopped
|
|
depends_on: [api]
|
|
ports:
|
|
- 127.0.0.1:21005:80
|
|
networks: [dev_default]
|
|
|
|
networks:
|
|
dev_default:
|
|
external: true
|