diff --git a/Dockerfile b/Dockerfile index 7bed2bd..b9e8cc1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,8 +14,11 @@ RUN mkdir -p ${SERVER} \ && wget -O - http://terraria.org/server/terraria-server-linux-${TERRARIA_VERISON}.tar.gz | tar -C ${SERVER} -xvz \ && ln -s ${SERVER}/terraria-server-linux-* ${SERVER}/server +ADD config.ini ${SERVER}/config.ini.default +ADD start.sh ${SERVER}/start.sh + VOLUME /data EXPOSE 7777/udp 7777 -ENTRYPOINT ["/home/gameserver/terraria/server/TerrariaServer.bin.x86_64"] -CMD ["-config", "/data/config.ini", "-steam", "-secure"] +ENTRYPOINT ["/home/gameserver/terraria/start.sh"] +CMD ["--"] diff --git a/config.ini b/config.ini new file mode 100644 index 0000000..37647db --- /dev/null +++ b/config.ini @@ -0,0 +1,68 @@ +#this is an example config file for TerrariaServer.exe +#use the command 'TerrariaServer.exe -config serverconfig.txt' to use this configuration or run start-server.bat +#please report crashes by emailing crashlog.txt to support@terraria.org + +#the following is a list of available command line parameters: + +#-config Specifies the configuration file to use. +#-port Specifies the port to listen on. +#-players / -maxplayers Sets the max number of players +#-pass / -password Sets the server password +#-world Load a world and automatically start the server. +#-autocreate <#> Creates a world if none is found in the path specified by -world. World size is specified by: 1(small), 2(medium), and 3(large). +#-banlist Specifies the location of the banlist. Defaults to "banlist.txt" in the working directory. +#-worldname Sets the name of the world when using -autocreate. +#-secure Adds addition cheat protection to the server. +#-noupnp Disables automatic port forwarding +#-steam Enables Steam Support +#-lobby or Allows friends to join the server or sets it to private if Steam is enabled +#-ip Sets the IP address for the server to listen on +#-forcepriority Sets the process priority for this task. If this is used the "priority" setting below will be ignored. + +#remove the # in front of commands to enable them. + +#Load a world and automatically start the server. +world=/data/world.wld + +#Creates a new world if none is found. World size is specified by: 1(small), 2(medium), and 3(large). +autocreate=3 + +#Sets the name of the world when using autocreate +worldname=Terraria + +#Sets the difficulty of the world when using autocreate 0(normal), 1(expert) +difficulty=1 + +#Sets the max number of players allowed on a server. Value must be between 1 and 255 +maxplayers=16 + +#Set the port number +port=7777 + +#Set the server password +#password=YOURSECRETPASSWORD + +#Set the message of the day +#motd=Please don?t cut the purple trees! + +#Sets the folder where world files will be stored +worldpath=/data/world + +#The location of the banlist. Defaults to "banlist.txt" in the working directory. +#banlist=banlist.txt + +#Adds addition cheat protection. +secure=1 + +#Sets the server language 1:English, 2:German, 3:Italian, 4:French, 5:Spanish +lang=1 + +#Automatically forward ports with uPNP +#upnp=1 + +#Reduces enemy skipping but increases bandwidth usage. The lower the number the less skipping will happen, but more data is sent. 0 is off. +#npcstream=60 + +#Default system priority 0:Realtime, 1:High, 2:AboveNormal, 3:Normal, 4:BelowNormal, 5:Idle +priority=1 + diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..4aed200 --- /dev/null +++ b/start.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +if ! [ -e /data/config.ini ]; then + cp ${SERVER}/config.ini.default /data/config.ini +fi + +exec ${SERVER}/server/TerrariaServer.bin.x86_64 \ + -config /data/config.ini