├── docker-entrypoint.sh ├── docker-compose.yaml ├── README.md ├── LICENSE ├── Dockerfile └── .github └── workflows └── build.yml /docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | java -jar -Dnogui=true /jmb/JMusicBot.jar 4 | -------------------------------------------------------------------------------- /docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '2.2' 2 | 3 | services: 4 | jmusicbot: 5 | image: craumix/jmusicbot 6 | container_name: jmusicbot 7 | restart: unless-stopped 8 | volumes: 9 | - ./config:/jmb/config 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # JMusicBot-Container 2 | [![Docker Pulls](https://img.shields.io/docker/pulls/craumix/jmusicbot)](https://hub.docker.com/r/craumix/jmusicbot) 3 | [![Docker Version](https://img.shields.io/docker/v/craumix/jmusicbot)](https://hub.docker.com/r/craumix/jmusicbot) 4 | [![Docker Image Size (tag)](https://img.shields.io/docker/image-size/craumix/jmusicbot/latest)](https://hub.docker.com/r/craumix/jmusicbot) 5 | 6 | A containerized version of the [JMusicBot by jagrosh](https://github.com/jagrosh/MusicBot). 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Sören Gürtler 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3 2 | 3 | LABEL maintainer="craumix " 4 | 5 | ARG BUILD_DATE 6 | ARG VCS_REF 7 | ARG VERSION 8 | 9 | LABEL org.label-schema.schema-version="1.0" 10 | LABEL org.label-schema.build-date=$BUILD_DATE 11 | LABEL org.label-schema.name="craumix/jmusicbot" 12 | LABEL org.label-schema.description="Java based Discord music bot" 13 | LABEL org.label-schema.url="https://github.com/jagrosh/MusicBot" 14 | LABEL org.label-schema.vcs-url="https://github.com/craumix/jmb-container" 15 | LABEL org.label-schema.vcs-ref=$VCS_REF 16 | LABEL org.label-schema.version=$VERSION 17 | LABEL org.label-schema.docker.cmd="docker run -v ./config:/jmb/config -d craumix/jmusicbot" 18 | 19 | RUN apk add --update --no-cache \ 20 | openjdk11-jre-headless tini 21 | 22 | #No downloadable example config since 0.2.10 23 | RUN mkdir -p /jmb/config 24 | ADD --chmod=644 https://github.com/jagrosh/MusicBot/releases/download/$VERSION/JMusicBot-$VERSION.jar /jmb/JMusicBot.jar 25 | ADD --chmod=644 https://github.com/jagrosh/MusicBot/releases/download/0.2.9/config.txt /jmb/config/config.txt 26 | 27 | COPY --chmod=755 ./docker-entrypoint.sh /jmb 28 | 29 | VOLUME /jmb/config 30 | 31 | RUN addgroup -S appgroup -g 10001 && \ 32 | adduser -S appuser -G appgroup -u 10000 33 | 34 | USER appuser 35 | 36 | WORKDIR /jmb/config 37 | 38 | ENTRYPOINT ["/sbin/tini", "--", "/jmb/docker-entrypoint.sh"] 39 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Docker Image Build 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | version: 7 | description: 'JMusicBot version' 8 | required: true 9 | 10 | jobs: 11 | buildx: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Checkout 15 | uses: actions/checkout@v4 16 | - name: Set up QEMU 17 | uses: docker/setup-qemu-action@v3 18 | - name: Set up Docker Buildx 19 | uses: docker/setup-buildx-action@v3 20 | - name: Login to DockerHub 21 | uses: docker/login-action@v3 22 | with: 23 | username: ${{ secrets.DOCKER_USERNAME }} 24 | password: ${{ secrets.DOCKER_PASSWORD }} 25 | - name: Set environment variables 26 | run: | 27 | echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV 28 | echo "VCS_REF=$(git rev-parse --short HEAD)" >> $GITHUB_ENV 29 | echo "VERSION=${{ inputs.version }}" >> $GITHUB_ENV 30 | - name: Build and push 31 | uses: docker/build-push-action@v6 32 | with: 33 | context: . 34 | file: ./Dockerfile 35 | platforms: linux/amd64,linux/arm64 36 | push: true 37 | build-args: | 38 | BUILD_DATE=${{ env.BUILD_DATE }} 39 | VCS_REF=${{ env.VCS_REF }} 40 | VERSION=${{ env.VERSION }} 41 | tags: | 42 | ${{ secrets.DOCKER_USERNAME }}/jmusicbot:${{ env.VERSION }} 43 | ${{ secrets.DOCKER_USERNAME }}/jmusicbot:latest --------------------------------------------------------------------------------