不足
Nginx UI 项目只能界面更改配置,但是需要重启Nginx 才会生效。
建议增加界面化启动方式。
Docker 化启动暴露端口也是个问题,只能用host模式。
用户界面
Docker 部署
-d
在后台作为守护进程运行--restart=always
在崩溃或服务器重新启动时重新启动--name nginxui
给容器起个名字-v /etc/nginx:/etc/nginx
将 hosts nginx 目录映射到容器中-p 8080:8080
将主机端口 8080 映射到 docker 容器端口 8080
docker run -d --restart=always --name nginxui -v /etc/nginx:/etc/nginx -p 8080:8080 schenkd/nginx-ui:latest
Docker compose 部署
version: '3'
services:
nginx-ui:
container_name: nginx-ui
build: .
image: nginx-ui:latest
ports:
- 8888:8080
volumes:
- nginx:/etc/nginx
nginx:
container_name: nginx
image: nginx:1.18.0-alpine
ports:
- 80:80
volumes:
- nginx:/etc/nginx
volumes:
nginx: