diff --git a/.github/workflows/voice.yml b/.github/workflows/voice.yml new file mode 100644 index 0000000..719103e --- /dev/null +++ b/.github/workflows/voice.yml @@ -0,0 +1,38 @@ +name: build voice +on: + # Allows you to run this workflow manually from the Actions tab + schedule: + - cron: "0 0 * * 1" + push: + branches: + - master + paths: + - voice/** +jobs: + push: + name: "yolks:voice_${{ matrix.tag }}" + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + tag: + - teaspeak + steps: + - uses: actions/checkout@v2 + - uses: docker/setup-buildx-action@v1 + with: + version: "v0.5.1" + buildkitd-flags: --debug + - uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.REGISTRY_TOKEN }} + - uses: docker/build-push-action@v2 + with: + context: ./voice/${{ matrix.tag }} + file: ./voice/${{ matrix.tag }}/Dockerfile + platforms: linux/amd64 + push: true + tags: | + ghcr.io/parkervcp/yolks:voice_${{ matrix.tag }} diff --git a/README.md b/README.md index 2ac804b..9a08c17 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,9 @@ is tagged correctly. * `ghcr.io/parkervcp/yolks:python_3.8` * [`python3.9`](/python/3.9) * `ghcr.io/parkervcp/yolks:python_3.9` - +### [Voice](/voice) + * [`TeaSpeak`](/teaspeak) + * `ghcr.io/parkervcp/yolks:voice:teaspeak` ### [Installation Images](/installers) * [`alpine-install`](/installers/alpine) diff --git a/voice/teaspeak/Dockerfile b/voice/teaspeak/Dockerfile new file mode 100644 index 0000000..809b228 --- /dev/null +++ b/voice/teaspeak/Dockerfile @@ -0,0 +1,52 @@ +# +# Copyright (c) 2021 Torsten Widmann +# +# 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. +# + +FROM --platform=$BUILDPLATFORM debian:stable-slim + +LABEL author="Torsten Widmann" maintainer="info@goover.de" + +LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" +LABEL org.opencontainers.image.licenses=MIT + +ENV DEBIAN_FRONTEND=noninteractive + +## update base packages +RUN apt update \ + && apt upgrade -y + +## install dependencies +RUN apt install -y ffmpeg curl python3 iproute2 libjemalloc2 + +# Install latest youtube-dl +RUN curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl +RUN chmod a+rx /usr/local/bin/youtube-dl + +RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1000 + +RUN useradd -m -d /home/container container + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +COPY ./entrypoint.sh /entrypoint.sh +CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/voice/teaspeak/entrypoint.sh b/voice/teaspeak/entrypoint.sh new file mode 100644 index 0000000..49123df --- /dev/null +++ b/voice/teaspeak/entrypoint.sh @@ -0,0 +1,24 @@ +# Default the TZ environment variable to UTC. +TZ=${TZ:-UTC} +export TZ + +# Set environment variable that holds the Internal Docker IP +INTERNAL_IP=$(ip route get 1 | awk '{print $NF;exit}') +export INTERNAL_IP + +# Switch to the container's working directory +cd /home/container || exit 1 + +echo "installed youtube-dl Version:" +/usr/local/bin/youtube-dl --version + +# Convert all of the "{{VARIABLE}}" parts of the command into the expected shell +# variable format of "${VARIABLE}" before evaluating the string and automatically +# replacing the values. +PARSED=$(echo "${STARTUP}" | sed -e 's/{{/${/g' -e 's/}}/}/g' | eval echo "$(cat -)") + +# Display the command we're running in the output, and then execute it with the env +# from the container itself. +printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0m%s\n" "$PARSED" +# shellcheck disable=SC2086 +exec env ${PARSED}