forked from jj5437/deeptrade
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
75 lines (70 loc) · 1.61 KB
/
docker-compose.yml
File metadata and controls
75 lines (70 loc) · 1.61 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
version: '3.8'
services:
# 后端服务
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: deeptrade-backend
ports:
- "8080:8080"
environment:
- NODE_ENV=production
- PORT=8080
env_file:
- ./backend/.env
volumes:
- backend_data:/usr/src/app/data
- backend_logs:/usr/src/app/logs
restart: unless-stopped
healthcheck:
test: ["CMD", "node", "-e", "require('http').get('http://localhost:8080/health', (res) => { process.exit(res.statusCode === 200 ? 0 : 1) })"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
networks:
- deeptrade-network
# 前端服务
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: deeptrade-frontend
restart: unless-stopped
depends_on:
- backend
networks:
- deeptrade-network
# Nginx反向代理
nginx:
image: nginx:alpine
container_name: deeptrade-nginx
ports:
- "5437:80"
- "443:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/ssl:/etc/nginx/ssl:ro
- nginx_logs:/var/log/nginx
depends_on:
- backend
- frontend
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost/health" ]
interval: 30s
timeout: 10s
retries: 3
networks:
- deeptrade-network
networks:
deeptrade-network:
driver: bridge
volumes:
backend_data:
driver: local
backend_logs:
driver: local
nginx_logs:
driver: local