docker-compose部署nginx
# docker-compose部署nginx
cat > docker-compose.yml << EOF
version: '3'
services:
nginx:
image: nginx
ports:
- "80:80"
- "443:443"
volumes:
- /data/nginx:/etc/nginx # 将主机上的nginx.conf文件挂载到容器中
- /var/www/html:/usr/share/nginx/html # 将主机上的web目录挂载到容器中
EOF
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
编辑 (opens new window)