-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
54 lines (54 loc) · 1.5 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
version: '3'
services:
nginx:
# 容器名称
container_name: "compose-nginx"
image: nginx:latest
restart: always
# 端口映射
ports:
- "80:80"
- "443:443"
environment:
- TZ=Asia/Shanghai
# 依赖关系 先跑php
depends_on:
- "php"
# 数据卷
volumes:
# 映射主机./conf.d目录到容器/etc/nginx/conf.d目录
- "./nginx/conf.d:/etc/nginx/conf.d"
- "./nginx/conf/nginx.conf:/etc/nginx/nginx.conf"
- "./nginx/html:/usr/share/nginx/html"
- "./nginx/log:/var/log/nginx/"
networks:
app_net:
ipv4_address: 10.10.10.2
php:
build: ./php-extension
image: php:7.4
restart: always
ports:
- "9000:9000"
volumes:
- "./nginx/html:/var/www/html"
- "./php74/etc:/usr/local/etc"
- "./php74/log:/var/log/php"
stdin_open: true
tty: true #这两条是防止启动php失败
networks:
app_net:
ipv4_address: 10.10.10.3
environment:
- TZ=Asia/Shanghai # 设置时区
container_name: "compose-php74"
networks:
# 配置docker network
app_net:
driver: bridge
driver_opts:
com.docker.network.enable_ipv6: "true"
ipam:
config:
# 子网络
- subnet: 10.10.0.0/16