forked from FragSoc/barotrauma-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
77 lines (62 loc) · 2.28 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
FROM steamcmd/steamcmd
MAINTAINER Laura Demkowicz-Duffy <[email protected]>
# Directories
ENV INSTALL_LOC="/barotrauma"
ENV CONFIG_LOC="/config"
ENV MODS_LOC="/mods"
ENV SAVES_LOC="/saves"
ENV CONF_BASE="/config_readonly"
# Required since useradd does not appear to set $HOME
ENV HOME=$INSTALL_LOC
# Build args
ARG UID=999
ARG GAME_PORT=27015
ARG STEAM_PORT=27016
ARG APPID=1026340
# Update and install unicode symbols
RUN apt-get update && \
apt-get install --no-install-recommends --assume-yes icu-devtools
# Create a dedicated user
RUN useradd -rs /bin/false -d $INSTALL_LOC -u $UID barotrauma
# Install the barotrauma server
RUN steamcmd \
+login anonymous \
+force_install_dir /barotrauma \
+app_update $APPID validate \
+quit
# Install scripts
COPY docker-entrypoint.sh /docker-entrypoint.sh
COPY install-mod.sh /usr/bin/install-mod
# Symlink the game's steam client object into the include directory
RUN ln -s $INSTALL_LOC/linux64/steamclient.so /usr/lib/steamclient.so
# Sort configs and directories
RUN mkdir -p $CONFIG_LOC $CONF_BASE && \
mv \
$INSTALL_LOC/serversettings.xml \
$INSTALL_LOC/Data/clientpermissions.xml \
$INSTALL_LOC/Data/permissionpresets.xml \
$INSTALL_LOC/Data/karmasettings.xml \
$CONF_BASE && \
ln -s $CONFIG_LOC/serversettings.xml $INSTALL_LOC/serversettings.xml && \
ln -s $CONFIG_LOC/config_player.xml $INSTALL_LOC/config_player.xml && \
ln -s $CONFIG_LOC/clientpermissions.xml $INSTALL_LOC/Data/clientpermissions.xml && \
ln -s $CONFIG_LOC/permissionpresets.xml $INSTALL_LOC/Data/permissionpresets.xml && \
ln -s $CONFIG_LOC/karmasettings.xml $INSTALL_LOC/Data/karmasettings.xml
# Setup mods folder
RUN mv $INSTALL_LOC/Mods $MODS_LOC && \
ln -s $MODS_LOC $INSTALL_LOC/Mods
# Setup saves folder
RUN mkdir -p "$INSTALL_LOC/Daedalic Entertainment GmbH" $SAVES_LOC && \
ln -s $SAVES_LOC "$INSTALL_LOC/Daedalic Entertainment GmbH/Barotrauma"
# Setup ServerLogs folder
RUN mkdir -p "$INSTALL_LOC/ServerLogs"
# Set directory permissions
RUN chown -R barotrauma:barotrauma \
$CONFIG_LOC $INSTALL_LOC $MODS_LOC $SAVES_LOC
# User and I/O
USER barotrauma
VOLUME $CONFIG_LOC $MODS_LOC $SAVES_LOC
EXPOSE $GAME_PORT/udp $STEAM_PORT/udp
# Exec
WORKDIR $INSTALL_LOC
ENTRYPOINT ["/docker-entrypoint.sh"]