c6748381760e3dc5fc7b280402a487043e666718
Some checks failed
Build and push Docker image / build (push) Failing after 5m32s
tshock-docker
Docker image + Compose scaffolding for TShock v5.2.4 (Terraria 1.4.4.9), plus a GitHub Actions workflow that builds and pushes to a custom registry (cr.nym.sh).
Repo layout
Dockerfile— builds the image by downloading the official TShock release assetdocker-compose.yml— example: shared./worlds+ separate per-server state under./data/worldX.github/workflows/build-and-push.yml— CI to build + push images to your registry
Local build
docker build -t tshock:5.2.4 .
Local run (two worlds, separate state)
mkdir -p worlds data/world1 data/world2
docker compose up world1 # first-time interactive prompts, Ctrl+C when done
docker compose up world2 # first-time interactive prompts, Ctrl+C when done
docker compose up -d
Players connect to:
host:7777→ world1host:7778→ world2
CI: push to cr.nym.sh
1) Create GitHub repo secrets
In your GitHub repo settings:
CRNYM_REGISTRY_USERNAMECRNYM_REGISTRY_PASSWORD
These should be credentials that can push to your registry.
2) Set image name (optional)
By default the workflow pushes to:
cr.nym.sh/<github-owner>/tshock
If you want a different path/name, edit IMAGE_NAME in the workflow.
3) Triggering
The workflow runs on:
- pushes to
main - git tags like
v5.2.4(recommended: tag releases) - manual runs (workflow_dispatch)
- a weekly scheduled rebuild (useful for base image security updates)
Tag strategy
lateston default branch (main)vX.Y.Ztag pushes also publishX.Y.Z- also publishes a short SHA tag for traceability
Notes / gotchas
- Don’t run two servers pointed at the same
.wldfile at once. - Keeping
./worldsshared is fine as long as each server uses a different world file. - On Linux, if the container can’t write to your bind mounts, you may need:
sudo chown -R 10001:10001 worlds data
Description
v5.2.4
Latest
Languages
Dockerfile
100%