From 6b55e984cb42b0539fbfe06b9744760927fb0045 Mon Sep 17 00:00:00 2001 From: unblockgames Date: Fri, 26 Jan 2024 23:36:22 -0600 Subject: [PATCH 1/2] Yaml upgrade --- Dockerfile | 1 + docker-compose.yaml | 9 +++++++++ entry.sh | 11 ++++++++--- readme.md | 5 ++++- 4 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 docker-compose.yaml diff --git a/Dockerfile b/Dockerfile index 02cc4e7..3761e92 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,7 @@ FROM cm2network/steamcmd:root +ENV HOMEDIR /home/steam ENV STEAMAPPID 343050 ENV STEAMAPP dst ENV STEAMAPPDIR "${HOMEDIR}/${STEAMAPP}-dedicated" diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..cb578dc --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,9 @@ +version: "3" +services: + dst-server: + image: catoverflow/dst-server:latest + ports: + - 10999:10999/udp + - 11000:11000/udp + volumes: + - /home/MyDediServer:/home/steam/.klei/DoNotStarveTogether/MyDediServer diff --git a/entry.sh b/entry.sh index d7a5d20..035b16a 100644 --- a/entry.sh +++ b/entry.sh @@ -12,6 +12,11 @@ bash "${STEAMCMDDIR}/steamcmd.sh" \ # launch master and cave server cd ${STEAMAPP}-dedicated/bin -# in case the server exits keeps the tmux window open -tmux new-session -d -s DST-dedicated -n Master "./dontstarve_dedicated_server_nullrenderer -console -cluster MyDediServer -shard Master; bash -i" -tmux new-window -d -n Cave -t DST-dedicated: "./dontstarve_dedicated_server_nullrenderer -console -cluster MyDediServer -shard Caves; bash -i" \ No newline at end of file + +./dontstarve_dedicated_server_nullrenderer -console -cluster MyDediServer -shard Master & + +./dontstarve_dedicated_server_nullrenderer -console -cluster MyDediServer -shard Caves & + +wait -n + +exit $? \ No newline at end of file diff --git a/readme.md b/readme.md index 4e80df4..76a3b3c 100644 --- a/readme.md +++ b/readme.md @@ -29,13 +29,16 @@ docker run \ -it catoverflow/dst-server ~~~~ +An example docker compose yaml file is also included. + ### Modding Follow the instructions in container at `/home/steam/dst-dedicated/mods/dedicated_server_mods_setup.lua` For mod settings, you can configure them in DST GUI and ship the settings at `~/.klel/DoNotStarveTogether/MyDediServer/[Master|Cave]/modoverrides.lua` -## Manage DST CLI +## DEPRECATED - Tmux is not recommended as this method forces you to -it in to the container and also prevent docker compose yamls from being used. Only left here for reference. +## Manage DST CLI [Tmux](https://www.redhat.com/sysadmin/introduction-tmux-linux) is used in multi-process management. A `DST-dedicated` session is created with window `Master` and `Cave` responsible for Master (main world) and Cave server. From 258dc7ab7f9bf3d8727f98141285719e20972977 Mon Sep 17 00:00:00 2001 From: unblockgames Date: Fri, 26 Jan 2024 23:40:36 -0600 Subject: [PATCH 2/2] docker buildx command --- readme.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/readme.md b/readme.md index 76a3b3c..9ce67e9 100644 --- a/readme.md +++ b/readme.md @@ -47,6 +47,13 @@ docker attach dst-dedicated # then use ^C-b + [0|1] to switch between Master and Cave tmux windows, ^C-p + q to detach from container ~~~~ +## Docker Build instructions +Image can be built using regular docker build commands, however, If you are on an ARM machine (Apple Silicon or other) you will need to use buildx. The following command is an example of how to build the image using buildx on an ARM device for amd 64. And ofc, after building, you'll need to tag your image for push. Enjoy. + +~~~~shell +docker buildx build . --load --platform linux/amd64 +~~~~ + ## Known Issues - Mapping different ports for cave server will make it unusable. Once you enter the cave you will be locked out, as the master server keeps redirecting you to inaccessible cave server port outside the container.