-
Notifications
You must be signed in to change notification settings - Fork 12
/
Dockerfile
35 lines (29 loc) · 1.03 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
FROM quay.io/justcontainers/base
ARG version="1449"
LABEL maintainer="[email protected]"
ADD "https://terraria.org/api/download/pc-dedicated-server/terraria-server-${version}.zip" /tmp/terraria.zip
RUN \
echo "**** install terraria ****" && \
apt-get update && \
apt-get install -y unzip && \
mkdir -p /root/.local/share/Terraria && \
echo "{}" > /root/.local/share/Terraria/favorites.json && \
mkdir -p /app/terraria/bin && \
unzip /tmp/terraria.zip ${version}'/Linux/*' -d /tmp/terraria && \
mv /tmp/terraria/${version}/Linux/* /app/terraria/bin && \
echo "**** creating user ****" && \
mkdir /config && \
useradd -u 911 -U -d /config -s /bin/false terraria && \
usermod -G users terraria && \
echo "**** cleanup ****" && \
apt-get clean && \
rm -rf \
/tmp/* \
/var/tmp/*
# add local files
COPY root/ /
# ports and volumes
EXPOSE 7777
VOLUME ["/world","/config"]
ENTRYPOINT ["/init"]
CMD ["/usr/bin/with-contenv", "s6-setuidgid", "terraria", "/app/terraria/bin/TerrariaServer.bin.x86_64", "-config", "/config/serverconfig.txt"]