From 123d3bcf3ffa593ed2d7cc355db41b87fe0e1ec1 Mon Sep 17 00:00:00 2001 From: PassiveLemon Date: Thu, 20 Jun 2024 10:57:34 -0400 Subject: [PATCH 1/3] Remove: Deprecated VERSION variable --- .github/workflows/main.yml | 1 - docker/Dockerfile | 3 --- 2 files changed, 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d4c1e99..9f84230 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,7 +33,6 @@ jobs: docker buildx create --name mainbuilder --driver docker-container --platform linux/amd64,linux/arm64 --use docker buildx build --push \ - --build-arg VERSION=${{ github.event.release.tag_name }} \ --provenance=false \ --platform linux/amd64,linux/arm64 \ --tag zoraxydocker/zoraxy:${{ github.event.release.tag_name }} \ diff --git a/docker/Dockerfile b/docker/Dockerfile index 8b50e38..eaef63c 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,6 +1,4 @@ FROM docker.io/golang:alpine -# VERSION comes from the main.yml workflow --build-arg -ARG VERSION RUN apk add --no-cache bash netcat-openbsd sudo @@ -26,7 +24,6 @@ RUN chmod 755 /usr/local/bin/zoraxy &&\ WORKDIR /opt/zoraxy/config/ -ENV VERSION=$VERSION ENV ARGS="-noauth=false" ENTRYPOINT "zoraxy" "-port=:8000" "-docker=true" "${ARGS}" From 3a2db63d61b72023d66b55fd5d8cf858b713e874 Mon Sep 17 00:00:00 2001 From: PassiveLemon Date: Thu, 20 Jun 2024 10:58:04 -0400 Subject: [PATCH 2/3] Refactor: Docker environment variables --- docker/Dockerfile | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index eaef63c..fc354ce 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -24,9 +24,21 @@ RUN chmod 755 /usr/local/bin/zoraxy &&\ WORKDIR /opt/zoraxy/config/ -ENV ARGS="-noauth=false" - -ENTRYPOINT "zoraxy" "-port=:8000" "-docker=true" "${ARGS}" - -HEALTHCHECK --interval=5s --timeout=5s --retries=2 CMD nc -vz 127.0.0.1 8000 || exit 1 +ENV AUTORENEW="86400" +ENV FASTGEOIP="false" +ENV LOG="true" +ENV MDNS="true" +ENV MDNSNAME="''" +ENV NOAUTH="false" +ENV PORT="8000" +ENV SSHLB="false" +ENV VERSION="false" +ENV WEBFM="true" +ENV WEBROOT="./www" +ENV ZTAUTH="''" +ENV ZTPORT="9993" + +ENTRYPOINT "zoraxy" "-docker=true" "-autorenew=${AUTORENEW}" "-fastgeoip=${FASTGEOIP}" "-log=${LOG}" "-mdns=${MDNS}" "-mdnsname=${MDNSNAME}" "-noauth=${NOAUTH}" "-port=:${PORT}" "-sshlb=${SSHLB}" "-version=${VERSION}" "-webfm=${WEBFM}" "-webroot=${WEBROOT}" "-ztauth=${ZTAUTH}" "-ztport=${ZTPORT}" + +HEALTHCHECK --interval=15s --timeout=5s --start-period=10s --retries=3 CMD nc -vz 127.0.0.1 $PORT || exit 1 From 2cd1b1de3c762f2bb435d8f34d433a1a65d4c8ae Mon Sep 17 00:00:00 2001 From: PassiveLemon Date: Thu, 20 Jun 2024 10:58:13 -0400 Subject: [PATCH 3/3] Update: Docker README --- docker/README.md | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/docker/README.md b/docker/README.md index 42cdd14..bf378c1 100644 --- a/docker/README.md +++ b/docker/README.md @@ -10,14 +10,15 @@ Although not required, it is recommended to give Zoraxy a dedicated location on You may also need to portforward your 80/443 to allow http and https traffic. If you are accessing the interface from outside of the local network, you may also need to forward your management port. If you know how to do this, great! If not, find the manufacturer of your router and search on how to do that. There are too many to be listed here.
+The examples below are not exactly how it should be set up, rather they give a general idea of usage. + ### Using Docker run
``` -docker run -d --name (container name) -p (ports) -v (path to storage directory):/opt/zoraxy/data/ -e ARGS='(your arguments)' zoraxydocker/zoraxy:latest +docker run -d --name (container name) -p 80:80 -p 443:443 -p (management external):(management internal) -v (path to storage directory):/opt/zoraxy/data/ -e (flag)="(value)" zoraxydocker/zoraxy:latest ``` ### Using Docker Compose
```yml -version: '3.3' services: zoraxy-docker: image: zoraxydocker/zoraxy:latest @@ -25,11 +26,11 @@ services: ports: - 80:80 - 443:443 - - (external):8000 + - (management external):(management internal) volumes: - (path to storage directory):/opt/zoraxy/config/ environment: - ARGS: '(your arguments)' + (flag): "(value)" ``` | Operator | Need | Details | @@ -38,18 +39,21 @@ services: | `--name (container name)` | No | Sets the name of the container to the following word. You can change this to whatever you want. | | `-p (ports)` | Yes | Depending on how your network is setup, you may need to portforward 80, 443, and the management port. | | `-v (path to storage directory):/opt/zoraxy/config/` | Recommend | Sets the folder that holds your files. This should be the place you just chose. By default, it will create a Docker volume for the files for persistency but they will not be accessible. | -| `-e ARGS='(your arguments)'` | No | Sets the arguments to run Zoraxy with. Enter them as you would normally. By default, it is ran with `-noauth=false` but you cannot change the management port. This is required for the healthcheck to work. | +| `-v /var/run/docker.sock:/var/run/docker.sock` | No | Used for autodiscovery. | +| `-e (flag)="(value)"` | No | Arguments to run Zoraxy with. They are simply just capitalized Zoraxy flags. `-docker=true` is always set by default. See examples below. | | `zoraxydocker/zoraxy:latest` | Yes | The repository on Docker hub. By default, it is the latest version that is published. | +> [!IMPORTANT] +> Docker usage of the port flag should not include the colon. Ex: PORT="8000" + ## Examples:
### Docker Run
``` -docker run -d --name zoraxy -p 80:80 -p 443:443 -p 8005:8000/tcp -v /home/docker/Containers/Zoraxy:/opt/zoraxy/config/ -e ARGS='-noauth=false' zoraxydocker/zoraxy:latest +docker run -d --name zoraxy -p 80:80 -p 443:443 -p 8005:8005 -v /home/docker/Containers/Zoraxy:/opt/zoraxy/config/ -v /var/run/docker.sock:/var/run/docker.sock -e PORT="8005" -e FASTGEOIP="true" zoraxydocker/zoraxy:latest ``` ### Docker Compose
```yml -version: '3.3' services: zoraxy-docker: image: zoraxydocker/zoraxy:latest @@ -57,9 +61,11 @@ services: ports: - 80:80 - 443:443 - - 8005:8000/tcp + - 8005:8005 volumes: - /home/docker/Containers/Zoraxy:/opt/zoraxy/config/ + - /var/run/docker.sock:/var/run/docker.sock environment: - ARGS: '-noauth=false' + PORT: "8005" + FASTGEOIP: "true" ```