-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdocker-compose.yml
59 lines (55 loc) · 1.57 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
48
49
50
51
52
53
54
55
56
57
58
59
version: "3"
networks:
hyperf:
driver: bridge
services:
redis:
container_name: redis
image: redis
restart: always
volumes:
- ${REDIS_DIR}/data:/data
- ${REDIS_DIR}/redis.conf:/usr/local/etc/redis/redis.conf
ports:
- "6379:6379"
networks:
- hyperf
# command: redis-server --requirepass ZpzyQrpUclFoikLV
command: redis-server /usr/local/etc/redis/redis.conf
tty: true
mysql:
container_name: mysql
image: mysql:5.7.20
restart: always
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: hyperf
MYSQL_USER: hyperf
MYSQL_PASSWORD: hyperf
volumes:
# 外部数据卷
- ${MYSQL_DIR}/data:/var/lib/mysql
# 外部初始化文件,文件名必须以 .sh 或 .sql 结尾
- ${MYSQL_DIR}/init:/docker-entrypoint-initdb.d
# 外部配置文件
# - ${MYSQL_DIR}/conf.d:/etc/mysql/conf.d
ports:
- "3306:3306"
networks:
- hyperf
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
tty: true
hyperf:
container_name: hyperf
image: hyperf/hyperf
volumes:
- ../wwwroot:/wwwroot
ports:
- "9501:9501"
- "9502:9502"
networks:
- hyperf
# command: php /wwwroot/bin/hyperf.php start
tty: true