Skip to content

Instantly share code, notes, and snippets.

@Xanir Xanir/Dockerfile
Created Mar 21, 2017

Embed
What would you like to do?
Terraria Dockerfile
FROM ubuntu:16.10
# Download and install TShock
ENV TSHOCK_VERSION=4.3.23 \
TSHOCK_FILE_POSTFIX=""
# Add mono repository
# Update and install mono and a zip utility
# fix for favorites.json error
RUN apt-get update && \
apt-get install -y dirmngr && \
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF && \
echo "deb http://download.mono-project.com/repo/debian wheezy main" | tee /etc/apt/sources.list.d/mono-xamarin.list && \
apt-get update && \
apt-get install -y mono-complete && \
favorites_path="/root/My Games/Terraria" && mkdir -p "$favorites_path" && echo "{}" > "$favorites_path/favorites.json"
RUN apt-get update && \
apt-get install -y curl zip && \
mkdir /var/tshock && \
cd /var/tshock && \
curl -L -o tshock.zip https://github.com/NyxStudios/TShock/releases/download/v$TSHOCK_VERSION/tshock_$TSHOCK_VERSION.zip && \
unzip tshock.zip -d /var/tshock && \
rm tshock.zip && \
chmod 777 /var/tshock/TerrariaServer.exe
# Allow for external data
VOLUME ["/world", "/var/tshock/ServerPlugins"]
# Set working directory to server
WORKDIR /var/tshock
# run the server
ENTRYPOINT ["mono", "--server", "--gc=sgen", "-O=all", "TerrariaServer.exe", "-configpath", "/world", "-worldpath", "/world", "-world", "world.wld", "-autocreate", "3", "-port", "7777", "-logpath", "/world"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.