-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
executable file
·47 lines (43 loc) · 1.1 KB
/
docker-compose.yml
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
version: '3.0'
services:
web:
build: .
volumes:
- .:/app/ # 将代码挂载到容器中
ports:
- "5000:5000" # 映射容器端口到主机
depends_on:
- mysql
- redis
celery:
build: .
command: celery -A run.celery worker --loglevel=info
depends_on:
- redis
- web # 依赖web服务
volumes:
- .:/app # 挂载代码目录
celery-beat: # 添加 Celery Beat 服务
build: .
command: celery -A run.celery beat --loglevel=info # 启动 Celery Beat
depends_on:
- redis
- web
volumes:
- .:/app
mysql:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: 123456 # MySQL root用户密码
MYSQL_USER: user # MySQL 用户
MYSQL_PASSWORD: password # MySQL 用户密码
ports:
- "3306:3306" # 映射MySQL端口
volumes:
- ./data/mysql-volume/mysql-data:/var/lib/mysql # 持久化MySQL数据
redis:
image: redis:6.2
ports:
- "6379:6379" # 映射Redis端口
volumes:
- ./data/redis-volume/redis-data:/var/lib/redis # 持久化Redis数据