typora/note/devops/nginx/docker-nginx.md
2024-12-12 10:48:55 +08:00

15 lines
341 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

### host模式挂载conf目录和日志路径
```bash
docker run -itd --name nginx \
--restart=always \
--network=mynet \
-p 8443:8443 \
-v /root/data/nginx/log:/var/log/nginx \
-v /root/data/nginx/conf.d:/etc/nginx/conf.d \
-v /root/data/nginx/ssl:/etc/nginx/ssl \
-v /root/data/nginx/nginx.conf:/etc/nginx/nginx.conf \
nginx:1.20
```