-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile
112 lines (96 loc) · 2.49 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
FROM steamcmd/steamcmd:ubuntu-24
STOPSIGNAL SIGTERM
####Environments####
ENV PUID=1000 PGID=1000 TimeZone=Europe/Madrid HOME=/home/sfserver LANG=en_US.utf8 TERM=xterm DEBIAN_FRONTEND=noninteractive \
START_MODE=1 \
TEST_ALERT=no \
TimeZone=Europe/Madrid \
VERSION=public \
MONITOR=no \
BACKUP=no
####Environments####
##############BASE IMAGE##############
####Labels####
LABEL maintainer="vinanrra"
LABEL build_version="version: 0.1.0"
#####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 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/*
##############BASE IMAGE##############
# Create user
RUN adduser --home /home/sfserver --disabled-password --shell /bin/bash --disabled-login --gecos "" sfserver
# Base dir
WORKDIR /home/sfserver
# Download linuxgsm script v23.7.0 + perms
RUN set -ex; \
wget https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/master/linuxgsm.sh && \
chmod +x linuxgsm.sh && \
su-exec sfserver bash linuxgsm.sh sfserver
# Add files with perms
COPY --chmod=755 install.sh user.sh /home/sfserver/
COPY --chmod=755 scripts /home/sfserver/scripts
##############EXTRA CONFIG##############
#Ports
EXPOSE 15777/udp 15000/udp 7777/udp
#Shared folders to host
VOLUME /home/sfserver/serverfiles/ /home/sfserver/log/ /home/sfserver/lgsm/backup/ /home/sfserver/lgsm/config-lgsm/sfserver/ /home/sfserver/.config/Epic/FactoryGame/Saved/SaveGames
##############EXTRA CONFIG##############
ENTRYPOINT ["/home/sfserver/user.sh"]