Skip to content

Instantly share code, notes, and snippets.

@halkeye
Created February 12, 2017 18:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save halkeye/e7974a9e485b6fc823809016f02cda91 to your computer and use it in GitHub Desktop.
Save halkeye/e7974a9e485b6fc823809016f02cda91 to your computer and use it in GitHub Desktop.
My systemd file for running terraria
[Unit]
Description=terraria
After=docker.service
Requires=docker.service
[Service]
TimeoutStartSec=0
Restart=always
# needed because tshock crashes when no stdin
StandardInput=tty
# Hijack tty11 for this purpose
TTYPath=/dev/tty11
# all output should stay in the journal though
StandardOutput=journal
ExecStartPre=-/usr/bin/docker stop terraria
ExecStartPre=-/usr/bin/docker rm terraria
ExecStop=/usr/bin/docker stop terraria
ExecStart=/usr/bin/docker run --rm -it \
-p 7777:7777 \
-v /storage/games/terraria/world:/world \
--name terraria \
ryshe/terraria:latest \
-autocreate 3 \
-world /world/Lg-Normal-17-02.wld
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment