-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
100 lines (93 loc) · 2.18 KB
/
Copy pathdocker-compose.yml
File metadata and controls
100 lines (93 loc) · 2.18 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
version: '3.8'
services:
# Nginx 网关
nginx:
image: nginx:alpine
container_name: academic-polisher_nginx
restart: always
ports:
- "80:80"
- "8080:8080"
volumes:
- ./app/config/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- backend
- frontend
networks:
- academic-polisher-network
# 前端应用
frontend:
build:
context: ./app
dockerfile: Dockerfile.frontend
container_name: academic-polisher_frontend
restart: always
networks:
- academic-polisher-network
# 后端应用
backend:
build:
context: ./app
dockerfile: Dockerfile.backend
container_name: academic-polisher_backend
restart: always
ports:
- "5000:5000"
env_file:
- .env
volumes:
- ./uploads:/app/uploads
- ./outputs:/app/outputs
- ./logs:/app/logs
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_started
networks:
- academic-polisher-network
# MySQL 数据库
mysql:
image: m.daocloud.io/docker.io/library/mysql:8.0
container_name: academic-polisher_mysql
restart: always
ports:
- "3306:3306"
env_file:
- .env
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
environment:
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
MYSQL_DATABASE: ${DB_NAME}
TZ: Asia/Shanghai
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${DB_PASSWORD}"]
interval: 5s
timeout: 5s
retries: 20
start_period: 30s
volumes:
- ./mysql_data:/var/lib/mysql
networks:
- academic-polisher-network
# Redis 缓存
redis:
image: redis:7.0-alpine
container_name: academic-polisher_redis
restart: always
ports:
- "6379:6379"
volumes:
- ./redis_data:/data
- ./app/config/redis.conf:/usr/local/etc/redis/redis.conf
command: redis-server /usr/local/etc/redis/redis.conf
networks:
- academic-polisher-network
# 网络配置
networks:
academic-polisher-network:
driver: bridge
# 数据卷
volumes:
mysql_data:
redis_data: