-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
84 lines (79 loc) · 1.9 KB
/
docker-compose.yml
File metadata and controls
84 lines (79 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
version: '3.8'
services:
# Redis服务 - 用于行情数据缓存
redis:
image: redis:6.2-alpine
container_name: qactpmd-redis
restart: unless-stopped
ports:
- "6379:6379"
volumes:
- redis_data:/data
command: redis-server --appendonly yes
networks:
- qactpmd-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 3
# QuantAxis多CTP行情网关
qactpmdgateway:
build:
context: .
dockerfile: Dockerfile
container_name: qactpmd-gateway
restart: unless-stopped
ports:
- "7799:7799" # WebSocket端口
volumes:
# 配置文件挂载
- ./config:/opt/quantaxis/qactpmdgateway/config:ro
# 日志文件持久化
- ./logs:/opt/quantaxis/qactpmdgateway/logs
# CTP flow文件持久化
- ./ctpflow:/opt/quantaxis/qactpmdgateway/ctpflow
# 备份目录
- ./backup:/opt/quantaxis/qactpmdgateway/backup
environment:
# 环境变量配置
- TZ=Asia/Shanghai
- REDIS_HOST=redis
- REDIS_PORT=6379
- LOG_LEVEL=INFO
depends_on:
redis:
condition: service_healthy
networks:
- qactpmd-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:7799/", "||", "exit", "1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
# 监控和管理界面 (可选)
portainer:
image: portainer/portainer-ce:latest
container_name: qactpmd-portainer
restart: unless-stopped
ports:
- "9000:9000"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- portainer_data:/data
networks:
- qactpmd-network
profiles:
- monitoring
volumes:
redis_data:
driver: local
portainer_data:
driver: local
networks:
qactpmd-network:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16