2018-06-03 12:10:42 +00:00
|
|
|
FROM debian:stretch
|
2015-11-22 12:25:25 +00:00
|
|
|
|
2018-06-03 12:10:42 +00:00
|
|
|
ENV TERRARIA_VERISON=1353 \
|
2018-06-08 10:34:37 +00:00
|
|
|
DUMB_INIT_VERSION=1.2.1 \
|
|
|
|
GOSU_VERSION=1.10 \
|
2018-07-06 16:33:11 +00:00
|
|
|
TERRARIA_DOCKER_VERSION=v0.3.0 \
|
2018-06-08 10:34:37 +00:00
|
|
|
HOME=/home/gameserver \
|
|
|
|
SERVER=/home/gameserver/terraria
|
2015-11-22 12:25:25 +00:00
|
|
|
|
2018-06-03 12:10:42 +00:00
|
|
|
RUN set -ex \
|
|
|
|
&& apt-get update \
|
|
|
|
&& apt-get install --no-install-recommends -y \
|
|
|
|
bash \
|
|
|
|
ca-certificates \
|
|
|
|
curl \
|
|
|
|
unzip \
|
|
|
|
&& useradd -m gameserver \
|
|
|
|
&& mkdir /data && chown gameserver: /data \
|
2018-06-08 10:34:37 +00:00
|
|
|
&& curl -sSfLo /usr/local/bin/dumb-init "https://github.com/Yelp/dumb-init/releases/download/v${DUMB_INIT_VERSION}/dumb-init_${DUMB_INIT_VERSION}_amd64" \
|
|
|
|
&& curl -sSfLo /usr/local/bin/gosu https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-amd64 \
|
|
|
|
&& curl -sSfL "https://github.com/Luzifer/terraria-docker/releases/download/${TERRARIA_DOCKER_VERSION}/terraria-docker_linux_amd64.tar.gz" | tar -xz -C /usr/local/bin \
|
|
|
|
&& chmod +x \
|
|
|
|
/usr/local/bin/dumb-init \
|
|
|
|
/usr/local/bin/gosu \
|
2018-06-03 12:10:42 +00:00
|
|
|
&& mkdir -p ${SERVER} \
|
2018-06-08 10:34:37 +00:00
|
|
|
&& curl -sSfLo /tmp/terraria.zip "http://terraria.org/server/terraria-server-${TERRARIA_VERISON}.zip" \
|
|
|
|
&& unzip -d ${SERVER} /tmp/terraria.zip \
|
|
|
|
&& chown -R gameserver:gameserver ${SERVER} \
|
|
|
|
&& rm /tmp/terraria.zip \
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
2015-11-22 12:25:25 +00:00
|
|
|
|
2018-06-03 12:10:42 +00:00
|
|
|
COPY config.ini ${SERVER}/config.ini.default
|
|
|
|
COPY start.sh ${SERVER}/start.sh
|
2018-06-08 10:34:37 +00:00
|
|
|
COPY terraria_cmd.sh /usr/local/bin/terraria_cmd
|
2015-11-22 12:34:49 +00:00
|
|
|
|
2015-11-22 12:25:25 +00:00
|
|
|
VOLUME /data
|
|
|
|
EXPOSE 7777/udp 7777
|
|
|
|
|
2015-11-22 12:34:49 +00:00
|
|
|
ENTRYPOINT ["/home/gameserver/terraria/start.sh"]
|
|
|
|
CMD ["--"]
|