-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
38 lines (38 loc) · 1.15 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
version: '3.3'
name: 'hyx-docker-1'
services:
nginx:
container_name: nginx_env
image: php:7.4.33-fpm
ports:
- "80:80"
- "81:81"
- "82:82"
- "9000:9000" # 开放php端口,开发使用为了本地不安装php检测代码作用
volumes:
- "./www:/var/www/html"
- "./etc/nginx/conf.d:/etc/nginx/conf.d"
- "./etc/nginx/nginx.conf:/etc/nginx/nginx.conf"
- "./etc/redis/redis.conf:/etc/redis/redis.conf"
build:
context: .
dockerfile: Dockerfile
mysql:
container_name: db
image: "mysql:5.7"
platform: linux/amd64 # mac专用 window需要注释掉
ports:
- "3306:3306"
environment:
MYSQL_DATABASE: "laravel"
MYSQL_ROOT_PASSWORD: "x"
TZ: "Asia/Shanghai" # 设置时区
volumes:
- "./mysql/my.cnf:/etc/mysql/my.cnf"
- "./mysql/data_dir:/var/lib/mysql"
command: mysqld --sql-mode=""
redis:
container_name: redis
image: redis
ports:
- "6379:6379"