-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.china.yml
More file actions
83 lines (78 loc) · 1.89 KB
/
docker-compose.china.yml
File metadata and controls
83 lines (78 loc) · 1.89 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
version: '3.8'
services:
vertree-app:
build:
context: .
dockerfile: Dockerfile.china
container_name: vertree-china
ports:
- "${SERVER_PORT:-8080}:8080"
env_file:
- sqlite.env
volumes:
- ./uploads:/root/uploads:rw
- ./data:/root/data:rw
- ./config:/root/config:ro
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
restart: unless-stopped
networks:
- vertree-network
# Redis for caching (可选,使用中国镜像)
redis:
image: redis:7-alpine
container_name: vertree-redis-china
ports:
- "${REDIS_PORT:-6379}:6379"
volumes:
- redis_data:/data
command: redis-server --appendonly yes
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 10s
retries: 3
restart: unless-stopped
networks:
- vertree-network
profiles:
- with-redis
# Nginx反向代理 (可选,用于生产环境,使用中国镜像)
nginx:
image: nginx:alpine
container_name: vertree-nginx-china
ports:
- "${NGINX_HTTP_PORT:-80}:80"
- "${NGINX_HTTPS_PORT:-443}:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./ssl:/etc/nginx/ssl:ro
- nginx_logs:/var/log/nginx
depends_on:
vertree-app:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost/health"]
interval: 30s
timeout: 10s
retries: 3
restart: unless-stopped
networks:
- vertree-network
profiles:
- production
volumes:
redis_data:
driver: local
nginx_logs:
driver: local
networks:
vertree-network:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16