Skip to content

Commit 2f759f8

Browse files
committed
bug fix
1 parent 9851fe8 commit 2f759f8

File tree

8 files changed

+50
-8
lines changed

8 files changed

+50
-8
lines changed

Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ EXPOSE 80 443
55

66
COPY resources/docker/start.sh /app/start.sh
77
COPY resources/docker/nginx.conf /usr/etc/nginx/nginx.conf
8-
COPY resources/docker/nginx-ui.conf /usr/etc/nginx/conf.d/default.conf
9-
COPY ./nginx-ui /app/nginx-ui
8+
COPY resources/docker/nginx-ui.conf /usr/etc/nginx/conf.d/nginx-ui.conf
9+
COPY resources/docker/nginx-ui.conf /etc/nginx/conf.d/nginx-ui.conf
10+
COPY nginx-ui /app/nginx-ui
1011

11-
RUN cd /app && chmod a+x /app/start.sh
12+
RUN cd /app && chmod a+x /app/start.sh && rm -f /etc/nginx/conf.d/default.conf
1213

1314
ENTRYPOINT ["./start.sh"]

README-zh_TW.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Nginx 網路管理介面,由 [0xJacky](https://jackyu.cn/) 與 [Hintay](https
3535
<ul>
3636
<li><a href="#透過執行檔案執行">透過執行檔案執行</a></li>
3737
<li><a href="#使用-systemd">使用 Systemd</a></li>
38+
<li><a href="#使用-docker">使用 Docker</a></li>
3839
</ul>
3940
</li>
4041
</ul>
@@ -158,6 +159,26 @@ systemctl stop nginx-ui
158159
```shell
159160
systemctl restart nginx-ui
160161
```
162+
163+
## 使用 Docker
164+
165+
Docker 示例
166+
- `nginx-ui:latest` 鏡像基於 `nginx:latest` 構建,
167+
您可以直接將該鏡像監聽到 80 和 443 端口以取代宿主機上的 Nginx
168+
169+
- 映射到 `/etc/nginx` 的文件夾應該為一個空目錄
170+
171+
```
172+
docker run -dit \
173+
--name=nginx-ui \
174+
--restart=always \
175+
-e TZ=Asia/Shanghai \
176+
-v /mnt/user/appdata/nginx:/etc/nginx \
177+
-v /mnt/user/appdata/nginx-ui:/etc/nginx-ui \
178+
-p 8080:80 -p 8443:443 \
179+
nginx-ui:latest
180+
```
181+
161182
## 手動構建
162183

163184
對於沒有官方構建版本的平臺,可以嘗試手動構建。

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Yet another Nginx Web UI, developed by [0xJacky](https://jackyu.cn/) and [Hintay
3333
<ul>
3434
<li><a href="#from-executable">From Executable</a></li>
3535
<li><a href="#with-systemd">With Systemd</a></li>
36+
<li><a href="#use-docker">Use Docker</a></li>
3637
</ul>
3738
</li>
3839
</ul>
@@ -157,6 +158,26 @@ systemctl stop nginx-ui
157158
```shell
158159
systemctl restart nginx-ui
159160
```
161+
162+
## Use Docker
163+
164+
Docker deploy example
165+
- `nginx-ui:latest` base on `nginx:latest`, you can replace the Nginx on host by publishing port 80 and 443 to host
166+
167+
- The volume mapping to `/etc/nginx` should be empty.
168+
169+
```
170+
docker run -dit \
171+
--name=nginx-ui \
172+
--restart=always \
173+
-e TZ=Asia/Shanghai \
174+
-v /mnt/user/appdata/nginx:/etc/nginx \
175+
-v /mnt/user/appdata/nginx-ui:/etc/nginx-ui \
176+
-p 8080:80 -p 8443:443 \
177+
nginx-ui:latest
178+
```
179+
180+
160181
## Manual Build
161182

162183
On platforms that do not have an official build version, they can be built manually.

build-demo.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ CGO_ENABLED=1 GOOS=linux CC=x86_64-unknown-linux-gnu-gcc \
33
CXX=x86_64-unknown-linux-gnu-g++ GOARCH=amd64 go build -ldflags \
44
"-X 'github.com/0xJacky/Nginx-UI/server/settings.buildTime=$(date +%s)'" -o nginx-ui -v main.go
55

6-
docker build -t nginx-ui-demo .
6+
docker build -f demo.Dockerfile -t nginx-ui-demo .
77
docker tag nginx-ui-demo uozi/nginx-ui-demo
88
docker push uozi/nginx-ui-demo

demo.Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ COPY resources/docker/nginx-ui.conf /etc/nginx/conf.d/nginx-ui.conf
1010
COPY resources/docker/start.sh /app/start.sh
1111
COPY nginx-ui /app/nginx-ui
1212

13-
RUN cd /app && chmod a+x start.sh
14-
13+
RUN cd /app && chmod a+x start.sh && rm -f /etc/nginx/conf.d/default.conf
1514

1615
ENTRYPOINT ["./start.sh"]

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nginx-ui-frontend",
3-
"version": "1.4.1",
3+
"version": "1.4.2",
44
"private": true,
55
"scripts": {
66
"serve": "vue-cli-service serve --port 8021",

frontend/version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":"1.4.1","build_id":4,"total_build":67}
1+
{"version":"1.4.2","build_id":1,"total_build":68}

nginx-ui

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)