17 lines
546 B
YAML
17 lines
546 B
YAML
services:
|
|
nginx:
|
|
image: nginx:latest
|
|
container_name: nginx
|
|
restart: always
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
volumes:
|
|
# 完全按照你的原版物理路径映射
|
|
- /opt/docker/nginx/logs:/etc/nginx/logs
|
|
- /opt/docker/nginx/html:/etc/nginx/html
|
|
- /opt/docker/nginx/cert:/etc/nginx/cert
|
|
- /opt/docker/nginx/conf:/etc/nginx/conf
|
|
|
|
# 核心主配置文件(确保执行过刚才的拷贝,宿主机上有这个文件)
|
|
- /opt/docker/nginx/conf/nginx.conf:/etc/nginx/nginx.conf |