Skip to content

Commit

Permalink
added docker for server
Browse files Browse the repository at this point in the history
  • Loading branch information
markuskonojacki committed Jul 31, 2022
1 parent 8e58030 commit 1b82f9e
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 1 deletion.
13 changes: 13 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -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
24 changes: 23 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
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
36 changes: 36 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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" ]
4 changes: 4 additions & 0 deletions settings.example.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
port=12113
password=test
ssl=true
compress=false

0 comments on commit 1b82f9e

Please sign in to comment.