Skip to content

Commit faa7e01

Browse files
authored
Merge pull request #9 from jsknnr/dev
Dev
2 parents 9fc02ea + 2d88104 commit faa7e01

File tree

8 files changed

+71
-23
lines changed

8 files changed

+71
-23
lines changed
Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,29 @@
11
name: Build and push Docker image
2-
32
on:
4-
push:
5-
branches: [ main ]
6-
7-
env:
8-
IMAGE_NAME: enshrouded-dedicated-server
3+
release:
4+
types: [created]
95

106
jobs:
11-
build:
7+
build-push:
128
runs-on: ubuntu-latest
139
steps:
14-
- name: Checkout repository
10+
- name: Checkout
1511
uses: actions/checkout@v4
1612

17-
- name: Login to Docker Hub
18-
uses: docker/login-action@v3
13+
- name: Build image
14+
id: buildah
15+
uses: redhat-actions/buildah-build@v2
1916
with:
20-
username: ${{ secrets.DOCKERHUB_USERNAME }}
21-
password: ${{ secrets.DOCKERHUB_TOKEN }}
17+
image: enshrouded-dedicated-server
18+
context: ./container
19+
containerfiles: Containerfile
20+
tags: latest ${{ github.event.release.tag_name }} # Use latest and the release tag
2221

23-
- name: Set up Docker Buildx
24-
uses: docker/setup-buildx-action@v3
25-
26-
- name: Build and push Docker image
27-
uses: docker/build-push-action@v5
22+
- name: Push image to Docker Hub
23+
uses: redhat-actions/push-to-registry@v2
2824
with:
29-
context: "{{defaultContext}}:docker"
30-
push: true
31-
tags: "${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:latest"
25+
image: ${{ steps.buildah.outputs.image }}
26+
tags: ${{ steps.buildah.outputs.tags }}
27+
registry: docker.io
28+
username: ${{ secrets.DOCKERHUB_USERNAME }}
29+
password: ${{ secrets.DOCKERHUB_TOKEN }}

README.md

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ The processes within the container do **NOT** run as root. Everything runs as th
3636
To run the container in Docker, run the following command:
3737

3838
```bash
39-
mkdir enshrouded-persistent-data
39+
docker volume create enshrouded-persistent-data
4040
docker run \
4141
--detach \
4242
--name enshrouded-server \
43-
--mount type=bind,source=$(pwd)/enshrouded-persistent-data,target=/home/steam/enshrouded/savegame \
43+
--mount type=volume,source=enshrouded-persistent-data,target=/home/steam/enshrouded/savegame \
4444
--publish 15636:15636/udp \
4545
--publish 15637:15637/udp \
4646
--env=SERVER_NAME="Enshrouded Containerized Server" \
@@ -51,7 +51,39 @@ docker run \
5151
sknnr/enshrouded-dedicated-server:latest
5252
```
5353

54-
Where ever you create the `enshrouded-persistent-data` directory is where the world save is going to go. If you delete that directory you will lose your save. That directory will be mounted into the container.
54+
### Docker Compose
55+
56+
To use Docker Compose, either clone this repo or copy the `compose.yaml` and `default.env` files out of the `container` directory to your local machine. You can leave the `compose.yaml` file uncahnged. Edit the `default.env` file to change the environment variables to the values you desire and then save the changes. Once you have made your changes, from the same directory that contains both the env file and the compose file, simply run:
57+
58+
```bash
59+
docker compose up -d -f compose.yaml
60+
```
61+
62+
To bring the container down:
63+
64+
```bash
65+
docker compose down -f compose.yaml
66+
```
67+
68+
### Podman
69+
70+
To run the container in Podman, run the following command:
71+
72+
```bash
73+
podman volume create enshrouded-persistent-data
74+
podman run \
75+
--detach \
76+
--name enshrouded-server \
77+
--mount type=volume,source=enshrouded-persistent-data,target=/home/steam/enshrouded/savegame \
78+
--publish 15636:15636/udp \
79+
--publish 15637:15637/udp \
80+
--env=SERVER_NAME="Enshrouded Containerized Server" \
81+
--env=SERVER_SLOTS=16 \
82+
--env=SERVER_PASSWORD="ChangeThisPlease" \
83+
--env=GAME_PORT=15636 \
84+
--env=QUERY_PORT=15637 \
85+
docker.io/sknnr/enshrouded-dedicated-server:latest
86+
```
5587

5688
### Kubernetes
5789

container/compose.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
services:
2+
enshrouded:
3+
image: sknnr/enshrouded-dedicated-server:latest
4+
ports:
5+
- "15636:15636/udp"
6+
- "15637:15637/udp"
7+
env_file:
8+
- default.env
9+
volumes:
10+
- enshrouded-persistent-data:/home/steam/enshrouded/savegame
11+
12+
volumes:
13+
enshrouded-persistent-data:

container/default.env

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
SERVER_NAME="Enshrouded Containerized"
2+
SERVER_PASSWORD="PleaseChangeMe"
3+
GAME_PORT="15636"
4+
QUERY_PORT="15637"
5+
SERVER_SLOTS="16"

0 commit comments

Comments
 (0)