-
Notifications
You must be signed in to change notification settings - Fork 48
/
Dockerfile
134 lines (112 loc) · 3.29 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
FROM steamcmd/steamcmd:ubuntu-24
STOPSIGNAL SIGTERM
##############BASE IMAGE##############
####Labels####
LABEL maintainer="vinanrra"
LABEL build_version="version: 0.7.8"
####Environments ####
ENV TimeZone=Europe/Madrid HOME=/home/sdtdserver LANG=en_US.utf8 TERM=xterm DEBIAN_FRONTEND=noninteractive
#####Dependencies####
# LinuxGSM dependencies
RUN dpkg --add-architecture i386 && \
apt update -y && \
apt install -y --no-install-recommends \
nano \
iproute2 \
curl \
wget \
file \
bzip2 \
gzip \
unzip \
unrar \
bsdmainutils \
python3 \
util-linux \
ca-certificates \
binutils \
bc \
jq \
tmux \
lib32gcc-s1 \
lib32stdc++6 \
libstdc++6 \
libstdc++6:i386 \
libxml2-utils \
telnet \
expect \
netcat-openbsd \
locales \
libgdiplus \
cron \
tclsh \
cpio \
libsdl2-2.0-0:i386 \
xz-utils \
distro-info \
git \
uuid-runtime \
pigz
# Install NodeJS
RUN curl -SLO https://deb.nodesource.com/nsolid_setup_deb.sh; \
chmod 500 nsolid_setup_deb.sh; \
./nsolid_setup_deb.sh 22; \
apt-get install nodejs -y
# Install gamedig
RUN npm install -g gamedig
# Install latest su-exec
RUN set -ex; \
\
curl -o /usr/local/bin/su-exec.c https://raw.githubusercontent.com/ncopa/su-exec/master/su-exec.c; \
\
fetch_deps='gcc libc-dev'; \
apt-get install -y --no-install-recommends $fetch_deps; \
gcc -Wall \
/usr/local/bin/su-exec.c -o/usr/local/bin/su-exec; \
chown root:root /usr/local/bin/su-exec; \
chmod 0755 /usr/local/bin/su-exec; \
rm /usr/local/bin/su-exec.c; \
\
apt-get purge -y --auto-remove $fetch_deps
# Clear unused files
RUN apt clean && \
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
#####Dependencies####
# Remove default user ubuntu
RUN deluser --remove-home ubuntu
# Create user and fix permissions - chown shouldn't be necessary check adduser command
RUN adduser --home /home/sdtdserver --disabled-password --shell /bin/bash --disabled-login --gecos "" sdtdserver \
&& chown -R sdtdserver:sdtdserver /home/sdtdserver
#Set ulimit as recommended by the game.
RUN echo 'sdtdserver soft nofile 10240' >> /etc/security/limits.conf
##Need use xterm for LinuxGSM##
ENV PUID=1000 PGID=1000 \
START_MODE=0 \
TEST_ALERT=no MONITOR=no \
BACKUP=no BACKUP_HOUR=5 BACKUP_MAX=7 \
VERSION=stable \
UPDATE_MODS=no \
ALLOC_FIXES=no ALLOC_FIXES_UPDATE=no \
UNDEAD_LEGACY=no UNDEAD_LEGACY_VERSION=stable UNDEAD_LEGACY_UPDATE=no UNDEAD_LEGACY_URL=False \
CPM=no CPM_UPDATE=no \
BEPINEX=no BEPINEX_UPDATE=no \
CHANGE_CONFIG_DIR_OWNERSHIP=YES \
DARKNESS_FALLS_URL=False DARKNESS_FALLS=no DARKNESS_FALLS_UPDATE=no
# Base dir
WORKDIR /home/sdtdserver
# Download LinuxGSM scripts
RUN wget -O linuxgsm.sh https://linuxgsm.sh && chmod +x linuxgsm.sh && su-exec sdtdserver bash linuxgsm.sh sdtdserver
##############BASE IMAGE##############
# Add files
COPY --chmod=755 install.sh user.sh /home/sdtdserver/
COPY --chmod=755 scripts/ /home/sdtdserver/scripts
##############EXTRA CONFIG##############
#Ports
EXPOSE 26900 26900/UDP 26901/UDP 26902/UDP 8082 8081 8080
#Shared folders to host
VOLUME /home/sdtdserver/serverfiles/ /home/sdtdserver/.local/share/7DaysToDie /home/sdtdserver/log/ /home/sdtdserver/lgsm/backup/ /home/sdtdserver/lgsm/config-lgsm/sdtdserver/
##############EXTRA CONFIG##############
ENTRYPOINT ["/home/sdtdserver/user.sh"]