Commit 1c5f232c authored by Eric Fossum's avatar Eric Fossum

Builds and runs, but no configurability.

parents
FROM ubuntu:18.04
ARG VERSION=1353
# Get the server archive
RUN apt update && \
apt install --yes \
curl \
unzip && \
rm -rf /var/lib/apt/lists/*
RUN curl \
--silent \
--output /opt/terraria-server.zip \
--remote-name http://terraria.org/server/terraria-server-${VERSION}.zip && \
unzip -qq /opt/terraria-server.zip -d /opt/ && \
rm /opt/terraria-server.zip
# Reorganize the folder.
RUN mv /opt/${VERSION}/Linux /opt/terraria && \
rm -rf /opt/${VERSION}
# Setup permissions.
RUN chown -R root:root /opt/terraria && \
chmod +x /opt/terraria/TerrariaServer.bin.x86* && \
useradd --system --create-home --home-dir /etc/terraria terraria
# Create configuration.
RUN echo $'maxplayers=16\n\
world=/etc/terraria/AutoWorld.wld\n\
password=some_pass\n\
motd=Please don’t cut the purple trees!\n\
worldpath=/etc/terraria/worlds\n\
autocreate=2\n\
difficulty=0\n\
worldname=AutoWorld\n\
secure=1\n\
language=en/US' > /opt/terraria/config.txt
EXPOSE 7777
CMD [ "/opt/terraria/TerrariaServer.bin.x86_64", "-config", "/opt/terraria/config.txt" ]
# Terraria Server Docker
## Environment Variables
* CONFIG_PATH
* MAXPLAYERS=8 - Sets the max number of players allowed on a server. Value must be between 1 and 255
* WORLD=C:\Users\Defaults\My Documents\My Games\Terraria\Worlds\world1.wld - Load a world and automatically start the server.
* PASSWORD=p@55w0rd* - Set the server password
* MOTD=Please don’t cut the purple trees! - Set the message of the day
* WORLDPATH=C:\Users\Defaults\My Documents\My Games\Terraria\Worlds\ - Sets the folder where world files will be stored
* AUTOCREATE=3 - Creates a new world if none is found. World size is specified by: 1(small), 2(medium), and 3(large).
* DIFFICULTY=0 - Sets world difficulty when using -autocreate. Options: 0(normal), 1(expert)
* WORLDNAME=World - Sets the name of the world when using autocreate
* BANLIST=banlist.txt - The location of the banlist. Defaults to "banlist.txt" in the working directory.
* SECURE=1 - Adds additional cheat protection.
* LANGUAGE - Sets the server language from its language code.
* available codes:
* en/US = English
* de/DE = German
* it/IT = Italian
* fr/FR = French
* es/ES = Spanish
* ru/RU = Russian
* zh/Hans = Chinese
* pt/BR = Portuguese
* pl/PL = Polish
## Important Files
* World (*.wld)
* Config (config.txt)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment