diff --git a/Dockerfile b/Dockerfile index 6154a6ce..539aa121 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,9 +5,10 @@ EXPOSE 80 443 COPY resources/docker/start.sh /app/start.sh COPY resources/docker/nginx.conf /usr/etc/nginx/nginx.conf -COPY resources/docker/nginx-ui.conf /usr/etc/nginx/conf.d/default.conf -COPY ./nginx-ui /app/nginx-ui +COPY resources/docker/nginx-ui.conf /usr/etc/nginx/conf.d/nginx-ui.conf +COPY resources/docker/nginx-ui.conf /etc/nginx/conf.d/nginx-ui.conf +COPY nginx-ui /app/nginx-ui -RUN cd /app && chmod a+x /app/start.sh +RUN cd /app && chmod a+x /app/start.sh && rm -f /etc/nginx/conf.d/default.conf ENTRYPOINT ["./start.sh"] diff --git a/README-zh_TW.md b/README-zh_TW.md index bd22820b..533911a9 100644 --- a/README-zh_TW.md +++ b/README-zh_TW.md @@ -35,6 +35,7 @@ Nginx 網路管理介面,由 [0xJacky](https://jackyu.cn/) 與 [Hintay](https
@@ -158,6 +159,26 @@ systemctl stop nginx-ui ```shell systemctl restart nginx-ui ``` + +## 使用 Docker + +Docker 示例 +- `nginx-ui:latest` 鏡像基於 `nginx:latest` 構建, + 您可以直接將該鏡像監聽到 80 和 443 端口以取代宿主機上的 Nginx + +- 映射到 `/etc/nginx` 的文件夾應該為一個空目錄 + +``` +docker run -dit \ + --name=nginx-ui \ + --restart=always \ + -e TZ=Asia/Shanghai \ + -v /mnt/user/appdata/nginx:/etc/nginx \ + -v /mnt/user/appdata/nginx-ui:/etc/nginx-ui \ + -p 8080:80 -p 8443:443 \ + nginx-ui:latest +``` + ## 手動構建 對於沒有官方構建版本的平臺,可以嘗試手動構建。 diff --git a/README.md b/README.md index 53cc578e..b7dc5e61 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ Yet another Nginx Web UI, developed by [0xJacky](https://jackyu.cn/) and [Hintay @@ -157,6 +158,26 @@ systemctl stop nginx-ui ```shell systemctl restart nginx-ui ``` + +## Use Docker + +Docker deploy example +- `nginx-ui:latest` base on `nginx:latest`, you can replace the Nginx on host by publishing port 80 and 443 to host + +- The volume mapping to `/etc/nginx` should be empty. + +``` +docker run -dit \ + --name=nginx-ui \ + --restart=always \ + -e TZ=Asia/Shanghai \ + -v /mnt/user/appdata/nginx:/etc/nginx \ + -v /mnt/user/appdata/nginx-ui:/etc/nginx-ui \ + -p 8080:80 -p 8443:443 \ + nginx-ui:latest +``` + + ## Manual Build On platforms that do not have an official build version, they can be built manually. diff --git a/build-demo.sh b/build-demo.sh index cc76c40a..5bc9e876 100755 --- a/build-demo.sh +++ b/build-demo.sh @@ -3,6 +3,6 @@ CGO_ENABLED=1 GOOS=linux CC=x86_64-unknown-linux-gnu-gcc \ CXX=x86_64-unknown-linux-gnu-g++ GOARCH=amd64 go build -ldflags \ "-X 'github.com/0xJacky/Nginx-UI/server/settings.buildTime=$(date +%s)'" -o nginx-ui -v main.go -docker build -t nginx-ui-demo . +docker build -f demo.Dockerfile -t nginx-ui-demo . docker tag nginx-ui-demo uozi/nginx-ui-demo docker push uozi/nginx-ui-demo diff --git a/demo.Dockerfile b/demo.Dockerfile index b60ccb55..32225b58 100644 --- a/demo.Dockerfile +++ b/demo.Dockerfile @@ -10,7 +10,6 @@ COPY resources/docker/nginx-ui.conf /etc/nginx/conf.d/nginx-ui.conf COPY resources/docker/start.sh /app/start.sh COPY nginx-ui /app/nginx-ui -RUN cd /app && chmod a+x start.sh - +RUN cd /app && chmod a+x start.sh && rm -f /etc/nginx/conf.d/default.conf ENTRYPOINT ["./start.sh"] diff --git a/frontend/package.json b/frontend/package.json index 8f740374..2f067563 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "nginx-ui-frontend", - "version": "1.4.1", + "version": "1.4.2", "private": true, "scripts": { "serve": "vue-cli-service serve --port 8021", diff --git a/frontend/version.json b/frontend/version.json index 433d0a0a..7fbc5893 100644 --- a/frontend/version.json +++ b/frontend/version.json @@ -1 +1 @@ -{"version":"1.4.1","build_id":4,"total_build":67} \ No newline at end of file +{"version":"1.4.2","build_id":1,"total_build":68} \ No newline at end of file diff --git a/nginx-ui b/nginx-ui index e3a87834..14bd2365 100755 Binary files a/nginx-ui and b/nginx-ui differ