From 7bbe148c213098a38fbe72611cd56b9278f58910 Mon Sep 17 00:00:00 2001 From: Ramid Khan Date: Mon, 27 Nov 2023 12:01:02 +1100 Subject: [PATCH 1/2] Docker Compose example --- docs/docker.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/docs/docker.md b/docs/docker.md index 0b89681bb..9a30f6ca0 100644 --- a/docs/docker.md +++ b/docs/docker.md @@ -43,3 +43,31 @@ docker run -p 7777:7777 -p 7878:7878 \ --rm -it tshock:linux-arm64 \ -world /worlds/backflip.wld -motd "ARM64 ftw" ``` + +## Using Docker Compose + +If you have [Docker Compose](https://docs.docker.com/compose/) installed, you can skip building the image explicitly, and rather use a `docker-compose.yml` file like so: +```yml +version: "3" + +services: + terraria: + build: + context: https://github.com/Pryaxis/TShock.git + args: + TARGETPLATFORM: linux/amd64 + container_name: terraria + restart: unless-stopped + volumes: + - "./tshock/:/tshock" + - "./worlds:/worlds" + - "./plugins:/plugins" + - "/etc/localtime:/etc/localtime:ro" + ports: + - "7777:7777" + - "7878:7878" # can be removed if you don't use the REST service + command: -world /worlds/my_world.wld +``` + +To run the server interactively, for example to generate a world, use `docker compose run --rm terraria` (without the `command:` for now). +Then, you can use `docker compose up -d` to run it in the background, and have it automatically restart with your host system. From a545a5c412d6d304f6ad5b7f7771ee5d68d0a304 Mon Sep 17 00:00:00 2001 From: Ramid Khan Date: Tue, 28 Nov 2023 09:57:11 +1100 Subject: [PATCH 2/2] Changelog entry --- docs/changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changelog.md b/docs/changelog.md index 035df8ada..1c38e9b5b 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -90,6 +90,7 @@ Use past tense when adding new entries; sign your name off when you add or chang * Added a property `TSPlayer.Hostile`, which gets pvp player mode. (@AgaSpace) * Fixed typo in `/gbuff`. (@sgkoishi, #2955) * Rewrote the `.dockerignore` file into a denylist. (@timschumi) +* Added an example Docker Compose script which doesn't require building TShock manually. (@ramidzkh) ## TShock 5.2 * An additional option `pvpwithnoteam` is added at `PvPMode` to enable PVP with no team. (@CelestialAnarchy, #2617, @ATFGK)