forked from NoFxAiOS/nofx
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
50 lines (46 loc) · 1.21 KB
/
docker-compose.yml
File metadata and controls
50 lines (46 loc) · 1.21 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
version: '3.8'
services:
# NOFX Trading Backend
nofx:
build:
context: .
dockerfile: Dockerfile
container_name: nofx-trading
restart: unless-stopped
ports:
- "8080:8080"
volumes:
- ./config.json:/app/config.json:ro
- ./decision_logs:/app/decision_logs
- /etc/localtime:/etc/localtime:ro # 同步主机时间
- frontend-dist:/app/web/dist-shared:rw # 共享前端文件
environment:
- TZ=Asia/Shanghai # 使用中国时区
networks:
- nofx-network
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
command: sh -c "cp -r /app/web/dist/* /app/web/dist-shared/ 2>/dev/null || true && exec ./nofx"
# Frontend (Nginx)
nofx-frontend:
image: nginx:alpine
container_name: nofx-frontend
restart: unless-stopped
ports:
- "3000:80"
volumes:
- frontend-dist:/usr/share/nginx/html:ro
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
networks:
- nofx-network
depends_on:
- nofx
volumes:
frontend-dist:
networks:
nofx-network:
driver: bridge