diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..cb417db --- /dev/null +++ b/.dockerignore @@ -0,0 +1,13 @@ +.git +.github +.vs +Logic +Server +Ui +docker-compose.yml.example +README.md +.dockerignore +LICENSE.txt +PhexensWuerfelraum.sln +screenshot.png +THIRD-PARTY-LICENSES.txt \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index aa05b8f..3a8d49f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -82,4 +82,26 @@ jobs: name: Phexens Würfelraum ${{ steps.get_version.outputs.version }} body: ${{ needs.build_changelog.outputs.changelog }} env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + docker: + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v3 + with: + push: true + tags: derevar/phexenswuerfelraum-server:latest \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..10fec96 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,36 @@ +FROM mono:6.12 + +ARG PUID=1000 +ARG PGID=1000 + +RUN apt-get update && apt-get install --no-install-recommends --yes \ + wget \ + unzip \ + && mkdir -p /app/config \ + && addgroup \ + --gid "$PGID" \ + phex \ + && adduser \ + --disabled-password \ + --gecos "" \ + --home /app \ + --ingroup phex \ + --uid "$PUID" \ + phex \ + && cd /app \ + && wget -q https://github.com/markuskonojacki/PhexensWuerfelraum/releases/download/$(curl -s https://api.github.com/repos/markuskonojacki/PhexensWuerfelraum/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')/Server-Linux-$(curl -s https://api.github.com/repos/markuskonojacki/PhexensWuerfelraum/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")').zip \ + && unzip -oq Server-Linux-*.zip \ + && rm -rf Server-Linux-*.zip \ + && chmod +x PhexensWuerfelraum.Server.Console + +COPY settings.example.ini /app/config/ + +RUN chown -R phex:phex /app + +WORKDIR /app + +USER phex + +EXPOSE 12113 + +CMD [ "/app/PhexensWuerfelraum.Server.Console" ] \ No newline at end of file diff --git a/settings.example.ini b/settings.example.ini new file mode 100644 index 0000000..e4a30c6 --- /dev/null +++ b/settings.example.ini @@ -0,0 +1,4 @@ +port=12113 +password=test +ssl=true +compress=false \ No newline at end of file