Merge pull request #36 from tobychui/Docker-2.1.0

Docker 2.1.0
This commit is contained in:
Toby Chui 2023-07-29 00:00:09 +08:00 committed by GitHub
commit d42ac8a146
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 7 deletions

View File

@ -1,7 +1,6 @@
FROM alpine:latest
FROM docker.io/golang:1.21rc3-alpine3.18
RUN apk update && apk upgrade &&\
apk add bash curl jq git go sudo
RUN apk add --no-cache bash curl jq git sudo
RUN mkdir -p /zoraxy/source/ &&\
mkdir -p /zoraxy/config/
@ -14,7 +13,7 @@ COPY notifier.sh /zoraxy/
RUN chmod 755 /zoraxy/ &&\
chmod +x /zoraxy/entrypoint.sh
ENV DOCKER="2.0.0"
ENV DOCKER="2.1.0"
ENV NOTIFS="1"
ENV VERSION="latest"

View File

@ -1,3 +1,5 @@
# [zoraxy-docker](https://github.com/tobychui/zoraxy/) </br>
[![Repo](https://img.shields.io/badge/Docker-Repo-007EC6?labelColor-555555&color-007EC6&logo=docker&logoColor=fff&style=flat-square)](https://hub.docker.com/r/passivelemon/zoraxy-docker)
[![Version](https://img.shields.io/docker/v/passivelemon/zoraxy-docker/latest?labelColor-555555&color-007EC6&style=flat-square)](https://hub.docker.com/r/passivelemon/zoraxy-docker)
[![Size](https://img.shields.io/docker/image-size/passivelemon/zoraxy-docker/latest?sort=semver&labelColor-555555&color-007EC6&style=flat-square)](https://hub.docker.com/r/passivelemon/zoraxy-docker)
@ -38,13 +40,13 @@ services:
| `-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):/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 `-port=:8000 -noauth=false` |
| `-e VERSION=(version)` | Recommended | Sets the version of Zoraxy that the container will download. Must be a supported release found on the Zoraxy GitHub. Defaults to the latest if not set. |
| `-e VERSION=(version)` | Recommended | Sets the version of Zoraxy that the container will download. Must be a supported release found on the Zoraxy GitHub. Make sure that it is not set to the containers version. Defaults to the latest if not set. |
| `passivelemon/zoraxy-docker:latest` | Yes | The repository on Docker hub. By default, it is the latest version that I have published. |
## Examples: </br>
### Docker Run </br>
```
docker run -d --name zoraxy -p 80:80 -p 443:443 -p 8005:8000/tcp -v /home/docker/Containers/Zoraxy:/zoraxy/config/ -e ARGS="-port=:8000 -noauth=false" passivelemon/zoraxy-docker:latest
docker run -d --name zoraxy -p 80:80 -p 443:443 -p 8005:8000/tcp -v /home/docker/Containers/Zoraxy:/zoraxy/config/ -e ARGS="-port=:8000 -noauth=false" -e VERSION="2.6.5" passivelemon/zoraxy-docker:latest
```
### Docker Compose </br>
@ -62,4 +64,5 @@ services:
- /home/docker/Containers/Zoraxy:/zoraxy/config/
environment:
ARGS: '-port=:8000 -noauth=false'
VERSION: '2.6.5'
```

View File

@ -1,5 +1,10 @@
#!/usr/bin/env bash
echo "|| Testing connectivity... ||"
if ! curl -sSf https://www.github.com > /dev/null; then
echo "|| GitHub could not be reached. Please check your internet connection and try again. ||"
exit
fi
if [ "$(curl -s "https://api.github.com/repos/tobychui/zoraxy/git/refs/tags" | jq 'any(.[] | tostring; test("API rate limit exceeded"))')" = "true" ]; then
echo "|| Currently rate limited by GitHub. Please wait until it clears. ||"
exit
@ -34,7 +39,7 @@ fi
if [ ! -f "/zoraxy/server/zoraxy_bin_${VERSION}" ]; then
echo "|| Cloning repository... ||"
cd /zoraxy/source/
git clone --depth=1 --branch main https://github.com/tobychui/zoraxy
git clone --depth 1 --single-branch --branch main https://github.com/tobychui/zoraxy
cd /zoraxy/source/zoraxy/src/
echo "|| Building... ||"
go mod tidy