From 2f759f8b2036547ec07da9d4b8e9aead57e2f942 Mon Sep 17 00:00:00 2001 From: 0xJacky Date: Sat, 23 Jul 2022 14:03:08 +0800 Subject: [PATCH] bug fix --- Dockerfile | 7 ++++--- README-zh_TW.md | 21 +++++++++++++++++++++ README.md | 21 +++++++++++++++++++++ build-demo.sh | 2 +- demo.Dockerfile | 3 +-- frontend/package.json | 2 +- frontend/version.json | 2 +- nginx-ui | Bin 29547824 -> 29547824 bytes 8 files changed, 50 insertions(+), 8 deletions(-) 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 e3a87834ab6bee6f65204fddfd4917693fe4d301..14bd2365fb8352ddd52f752bb53f8a0ffd6a8915 100755 GIT binary patch delta 2070 zcmW;MRaX!Q5J2IB*d5s2D56N&iJc%QcDIOuUD$<+irw7-iiLr?-QC^Y?dHAv@ZB@> z179uXUs(LOLFC@OqvT>Rvu2@A%BCUlF9 z85_|wq4$c^z%{9X0muXAyvT?AD1d?}gu*C-q9}&qD1nkFh0-X4Ae2Qplt%?rL?u*4 z6;wqvR7VZeL@m@t9n?iV)JHHHpdmug2%%_`4Die*@i6@Gu_1qj(ID;|V;8 zr|>kM!LxV{&*KHWh?np(Ucsw)4X@)3yotB)Hr~Ozcn|O61AK^&@G(BYr}zw?;|qL= zukba#!MFGh-{S}Th@bE?e!;K!4Zq_LJiwp$3xDGu{F}z@r^Dni|F3zS@|pamfGKDS znZl-sDQb$D;--Wt8Ia3A2$-FfKPoCRDx!J%gX~fPq_inxf=pRc&XhM5Ohr@4R5n#i zRa4DWH#JO6Q_Ivgbxd7T&(t@;rh#c_LQEqQY8sm+Cd@Q7;U>aFnkW-(nwjRNg=uM8 znbxL_X=~b<_NIgBXktt!)7f+}T}?OB-SjX$O)t~i^f7%+tcf%IOuR`j{mlTAXa<@= zX0RDzhMHk!xEWzano(x78Dqwpab~=kU?!SLX0n-LlFU?-Y^Is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