Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
0xJacky committed Jul 23, 2022
1 parent 9851fe8 commit 2f759f8
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 8 deletions.
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
21 changes: 21 additions & 0 deletions README-zh_TW.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Nginx 網路管理介面,由 [0xJacky](https://jackyu.cn/) 與 [Hintay](https
<ul>
<li><a href="#透過執行檔案執行">透過執行檔案執行</a></li>
<li><a href="#使用-systemd">使用 Systemd</a></li>
<li><a href="#使用-docker">使用 Docker</a></li>
</ul>
</li>
</ul>
Expand Down Expand Up @@ -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
```

## 手動構建

對於沒有官方構建版本的平臺,可以嘗試手動構建。
Expand Down
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Yet another Nginx Web UI, developed by [0xJacky](https://jackyu.cn/) and [Hintay
<ul>
<li><a href="#from-executable">From Executable</a></li>
<li><a href="#with-systemd">With Systemd</a></li>
<li><a href="#use-docker">Use Docker</a></li>
</ul>
</li>
</ul>
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion build-demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 1 addition & 2 deletions demo.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion frontend/version.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"1.4.1","build_id":4,"total_build":67}
{"version":"1.4.2","build_id":1,"total_build":68}
Binary file modified nginx-ui
Binary file not shown.

0 comments on commit 2f759f8

Please sign in to comment.