-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
113 lines (105 loc) · 2.65 KB
/
docker-compose.yml
File metadata and controls
113 lines (105 loc) · 2.65 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
version: '3.8'
services:
quantmesh:
build:
context: .
dockerfile: Dockerfile
container_name: quantmesh
restart: unless-stopped
ports:
- "8080:8080"
volumes:
- ./config.yaml:/app/config.yaml:ro
- ./data:/app/data
- ./logs:/app/logs
- ./plugins:/app/plugins:ro
environment:
- TZ=Asia/Shanghai
- GIN_MODE=release
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/health"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
networks:
- quantmesh-network
# PostgreSQL 数据库 (可选,用于多实例部署)
postgres:
image: postgres:15-alpine
container_name: quantmesh-db
restart: unless-stopped
environment:
- POSTGRES_USER=quantmesh
- POSTGRES_PASSWORD=quantmesh_password
- POSTGRES_DB=quantmesh
volumes:
- postgres-data:/var/lib/postgresql/data
ports:
- "5432:5432"
networks:
- quantmesh-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U quantmesh"]
interval: 10s
timeout: 5s
retries: 5
# Redis (可选,用于分布式锁)
redis:
image: redis:7-alpine
container_name: quantmesh-redis
restart: unless-stopped
command: redis-server --appendonly yes
volumes:
- redis-data:/data
ports:
- "6379:6379"
networks:
- quantmesh-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 3
# Prometheus (可选,用于监控)
prometheus:
image: prom/prometheus:latest
container_name: quantmesh-prometheus
restart: unless-stopped
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
volumes:
- ./monitoring/prometheus:/etc/prometheus
- prometheus-data:/prometheus
ports:
- "9090:9090"
networks:
- quantmesh-network
# Grafana (可选,用于可视化)
grafana:
image: grafana/grafana:latest
container_name: quantmesh-grafana
restart: unless-stopped
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_USERS_ALLOW_SIGN_UP=false
volumes:
- ./monitoring/grafana:/etc/grafana/provisioning
- grafana-data:/var/lib/grafana
ports:
- "3000:3000"
networks:
- quantmesh-network
depends_on:
- prometheus
networks:
quantmesh-network:
driver: bridge
volumes:
postgres-data:
redis-data:
prometheus-data:
grafana-data: