Skip to content
This repository has been archived by the owner on Aug 25, 2023. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
PassiveLemon committed May 22, 2023
1 parent 9fbdf4a commit dd8a4e9
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 3 deletions.
16 changes: 15 additions & 1 deletion .gitattributes 100644 → 100755
@@ -1,2 +1,16 @@
# Auto detect text files and perform LF normalization
# auto convert unless specified
* text=auto

# ctrl
*.bat text eol=ctrl
*.ps1 text eol=ctrl

# lf
*.sh text eol=lf
*.nix text eol=lf

# binary (not text files)
*.png binary
*.jpg binary
*.jpeg binary
*.webp binary
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
ContainerTester.sh
ImagePublisher.sh
15 changes: 15 additions & 0 deletions Dockerfile
@@ -0,0 +1,15 @@
FROM alpine:latest

RUN apk update && apk upgrade &&\
apk add bash curl jq &&\
mkdir -p /zoraxy/data/

COPY entrypoint.sh /zoraxy/

RUN chmod +x /zoraxy/entrypoint.sh

ENV ARGS="-port=:8000 -noauth=false"

EXPOSE ${PORT}

ENTRYPOINT ["/zoraxy/entrypoint.sh"]
21 changes: 21 additions & 0 deletions LICENSE
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 PassiveLemon

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
32 changes: 30 additions & 2 deletions README.md
@@ -1,2 +1,30 @@
# zoraxy-docker

# zoraxy-docker </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/latest?sort=semver&labelColor-555555&color-007EC6&style=flat-square)](https://hub.docker.com/r/passivelemon/zoraxy)
[![Pulls](https://img.shields.io/docker/pulls/passivelemon/zoraxy?labelColor-555555&color-007EC6&style=flat-square)](https://hub.docker.com/r/passivelemon/zoraxy)

Docker container for [Zoraxy](https://github.com/tobychui/zoraxy) </br>

## Setup </br>
There really isn't much here, just make sure you find a good place to store the files. The container will download everything automatically so this place is used to store the files so they aren't deleted when the container is deleted. </br>

### Docker container </br>
```
docker run -d --name (container name) -p (ports) -v (path to storage directory):/zoraxy/data/ -e ARGS=(your arguments) -e VERSION=(version) passivelemon/zoraxy-docker:latest
```

| Operator | Need | Details |
|:-|:-|:-|
| `-d` | Yes | will run the container in the background. |
| `--name (container name)` | No | Sets the name of the container to the following word. You can change this to whatever you want. |
| `-v (path to storage directory):/zoraxy/data/` | Yes | Sets the folder that holds your files. This should be the place you just chose. |
| `-e ARGS=(your arguments)` | No | Sets the arguments to run Zoraxy with. By default, it is ran with `-port=:8000 -noauth=false` |
| `-e VERSION=(version)` | No | Sets the version of Zoraxy that the container will download. Must be a supported version found on the Zoraxy Github. 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. |

#### Example:
```
docker run -d --name zoraxy -p 8000:8000/tcp -v /home/docker/Containers/Zoraxy:/zoraxy/data/ -e ARGS="-port=:8000 -noauth=false" passivelemon/zoraxy-docker:latest
```
20 changes: 20 additions & 0 deletions entrypoint.sh
@@ -0,0 +1,20 @@
#!/usr/bin/env bash

cd /zoraxy/data/

if [ "$VERSION" != "" ]; then
echo "|| Using release ${VERSION} ||"
release=${VERSION}
else
echo "|| Using latest release ||"
# Gets the latest pre-release version tag.
release=$(curl -s https://api.github.com/repos/tobychui/zoraxy/releases | jq -r 'map(select(.prerelease)) | .[0].tag_name')
fi

if [ ! -e /zoraxy/data/zoraxy_linux_amd64 ]; then
echo "|| Downloading version ${release} ||"
curl -sL --output /zoraxy/data/zoraxy_linux_amd64 https://github.com/tobychui/zoraxy/releases/download/${release}/zoraxy_linux_amd64
chmod u+x /zoraxy/data/zoraxy_linux_amd64
fi

./zoraxy_linux_amd64 ${ARGS}

0 comments on commit dd8a4e9

Please sign in to comment.