-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
36 lines (35 loc) · 1.13 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
36 lines (35 loc) · 1.13 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
version: "3"
services:
muzi:
build: ./
container_name: muzi_space
ports:
- "8001:80"
volumes:
- /Users/lidongbin/code/ldb/code:/data/web/:cached
- ./conf/nginx/conf.d:/usr/local/openresty/nginx/conf/conf.d
- ./conf/nginx/nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf
depends_on: # 容器依赖
- redis
- mysql
mysql:
image: mysql:5.7
# network_mode: "host" # 如果需要容器使用宿主机IP(内网IP),则可以配置此项
container_name: muzi_mysql # 指定容器名称,如果不设置此参数,则由系统自动生成
# restart: always # 设置容器自启模式
command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci # 设置utf8字符集
environment:
- TZ=Asia/Shanghai # 设置容器时区与宿主机保持一致
- MYSQL_ROOT_PASSWORD=root # 设置root密码
volumes:
- ./data/mysql/:/var/lib/mysql
ports:
- "33062:3306"
redis:
image: redis:latest
container_name: muzi_redis
# restart: always
environment:
TZ: "Asia/Shanghai"
ports:
- "63792:6379"