-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
126 lines (120 loc) · 2.8 KB
/
docker-compose.yaml
File metadata and controls
126 lines (120 loc) · 2.8 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
services:
# Redis
redis:
image: registry.cn-hangzhou.aliyuncs.com/txf7/redis:7-alpine
container_name: cscan_redis
command: redis-server --appendonly yes
volumes:
- cscan_redis_data:/data
environment:
- TZ=Asia/Shanghai
restart: unless-stopped
networks:
- cscan_network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 3
# MongoDB
mongodb:
image: registry.cn-hangzhou.aliyuncs.com/txf7/mongo:6
container_name: cscan_mongodb
volumes:
- cscan_mongodb_data:/data/db
- ./docker/mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
environment:
- TZ=Asia/Shanghai
restart: unless-stopped
networks:
- cscan_network
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 10s
timeout: 5s
retries: 3
# CSCAN API 服务
cscan-api:
image: registry.cn-hangzhou.aliyuncs.com/txf7/cscan-api:latest
container_name: cscan_api
environment:
- TZ=Asia/Shanghai
- GOMAXPROCS=4
- CSCAN_JWT_SECRET=${CSCAN_JWT_SECRET}
volumes:
- cscan_api_data:/app/data
ports:
- "8888:8888"
depends_on:
redis:
condition: service_healthy
mongodb:
condition: service_healthy
restart: unless-stopped
networks:
- cscan_network
deploy:
resources:
limits:
cpus: '2'
memory: 2G
reservations:
cpus: '0.5'
memory: 512M
healthcheck:
test: ["CMD", "sh", "-c", "wget --quiet --tries=1 --spider http://localhost:8888/health || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# CSCAN RPC 服务
cscan-rpc:
image: registry.cn-hangzhou.aliyuncs.com/txf7/cscan-rpc:latest
container_name: cscan_rpc
environment:
- TZ=Asia/Shanghai
- GOMAXPROCS=4
depends_on:
redis:
condition: service_healthy
mongodb:
condition: service_healthy
restart: unless-stopped
networks:
- cscan_network
deploy:
resources:
limits:
cpus: '2'
memory: 2G
reservations:
cpus: '0.5'
memory: 512M
# CSCAN Web
cscan-web:
image: registry.cn-hangzhou.aliyuncs.com/txf7/cscan-web:latest
container_name: cscan_web
environment:
- TZ=Asia/Shanghai
ports:
- "3000:80"
- "7777:443"
volumes:
- cscan_ssl_certs:/etc/nginx/ssl
depends_on:
- cscan-api
restart: unless-stopped
networks:
- cscan_network
volumes:
cscan_redis_data:
driver: local
cscan_mongodb_data:
driver: local
cscan_ssl_certs:
driver: local
cscan_api_data:
driver: local
networks:
cscan_network:
driver: bridge