diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..08b2786 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,43 @@ + +name: Docker Image CI +on: + workflow_dispatch: + schedule: + - cron: "0 0 * * 1" + push: + branches: + - main + paths: + - /** +jobs: + qemu: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v2 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + with: + version: "v0.5.1" + buildkitd-flags: --debug + - + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: Luxxy-GF + password: ${{ secrets.REGISTRY_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v2 + with: + context: ./ + file: ./Dockerfile + platforms: linux/amd64 + push: true + tags: | + ghcr.io/luxxy-gf/pterodactyl-qbittorrent \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3361700 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM debian:bookworm-slim + +# Path: Dockerfile + +RUN apt-get update && apt upgrade -y && apt-get install -y \ + build-essential \ + curl \ + git \ + libssl-dev \ + pkg-config \ + && rm -rf /var/lib/apt/lists/* + +RUN useradd -m -d /home/container container + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +COPY ./entrypoint.sh /entrypoint.sh +COPY --chmod=777 ./start.sh /start.sh +COPY --chmod=777 ./qbittorrent /qbittorrent +CMD [ "/bin/bash", "/entrypoint.sh" ] \ No newline at end of file diff --git a/compose-dev.yaml b/compose-dev.yaml new file mode 100644 index 0000000..a92f701 --- /dev/null +++ b/compose-dev.yaml @@ -0,0 +1,12 @@ +services: + app: + entrypoint: + - sleep + - infinity + image: docker/dev-environments-default:stable-1 + init: true + volumes: + - type: bind + source: /var/run/docker.sock + target: /var/run/docker.sock + diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..20982ef --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,14 @@ +#!/bin/bash +cd /home/container || exit 1 + +# Configure colors +CYAN='\033[0;36m' +RESET_COLOR='\033[0m' + +# Replace Startup Variables +# shellcheck disable=SC2086 +echo -e "${CYAN}STARTUP /home/container: /start.sh ${RESET_COLOR}" +# Run the Server +# shellcheck disable=SC2086 + +eval '/start.sh' \ No newline at end of file diff --git a/qbittorrent b/qbittorrent new file mode 100644 index 0000000..d5a4018 Binary files /dev/null and b/qbittorrent differ diff --git a/start.sh b/start.sh new file mode 100644 index 0000000..4af2c07 --- /dev/null +++ b/start.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +#Path: start.sh + +echo -e "Starting the server" + +# Start the first process + +/qbittorrent --webui-port=${SERVER_PORT} --profile=/home/container/.config/qBittorrent/ --configuration=/home/container/.config/qBittorrent/ --save-path /home/container/downloads/ +