以下是一个使用Docker Compose运行Nginx的YAML文件示例:
version:'3'
services:
nginx:
image: nginx:latest
container_name: nginx
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./html:/usr/share/nginx/html
- ./logs:/var/log/nginx