Skip to content

Commit 9ce395b

Browse files
authored
feat: Allow to choose LinuxGSM version from github (#287)
1 parent 379068d commit 9ce395b

File tree

5 files changed

+53
-55
lines changed

5 files changed

+53
-55
lines changed

Dockerfile

+45-39
Original file line numberDiff line numberDiff line change
@@ -9,49 +9,54 @@ LABEL maintainer="vinanrra"
99
LABEL build_version="version: 0.7.8"
1010

1111
####Environments ####
12-
ENV TimeZone=Europe/Madrid HOME=/home/sdtdserver LANG=en_US.utf8 TERM=xterm DEBIAN_FRONTEND=noninteractive
12+
##Need use xterm for LinuxGSM##
13+
ENV DEBIAN_FRONTEND=noninteractive \
14+
HOME=/home/sdtdserver \
15+
LANG=en_US.utf8 \
16+
TERM=xterm \
17+
TimeZone=Europe/Madrid
1318

1419
#####Dependencies####
1520

1621
# LinuxGSM dependencies
1722
RUN dpkg --add-architecture i386 && \
1823
apt update -y && \
1924
apt install -y --no-install-recommends \
20-
nano \
21-
iproute2 \
25+
bc \
26+
binutils \
27+
bsdmainutils \
28+
bzip2 \
29+
ca-certificates \
30+
cpio \
31+
cron \
2232
curl \
23-
wget \
33+
distro-info \
34+
expect \
2435
file \
25-
bzip2 \
36+
git \
2637
gzip \
27-
unzip \
28-
unrar \
29-
bsdmainutils \
30-
python3 \
31-
util-linux \
32-
ca-certificates \
33-
binutils \
34-
bc \
38+
iproute2 \
3539
jq \
36-
tmux \
3740
lib32gcc-s1 \
3841
lib32stdc++6 \
42+
libgdiplus \
43+
libsdl2-2.0-0:i386 \
3944
libstdc++6 \
4045
libstdc++6:i386 \
4146
libxml2-utils \
42-
telnet \
43-
expect \
44-
netcat-openbsd \
4547
locales \
46-
libgdiplus \
47-
cron \
48+
nano \
49+
netcat-openbsd \
50+
python3 \
4851
tclsh \
49-
cpio \
50-
libsdl2-2.0-0:i386 \
51-
xz-utils \
52-
distro-info \
53-
git \
52+
telnet \
53+
tmux \
54+
unrar \
55+
unzip \
56+
util-linux \
5457
uuid-runtime \
58+
wget \
59+
xz-utils \
5560
pigz
5661

5762
# Install NodeJS
@@ -87,6 +92,20 @@ RUN apt clean && \
8792

8893
#####Dependencies####
8994

95+
ENV ALLOC_FIXES=no ALLOC_FIXES_UPDATE=no \
96+
BACKUP=no BACKUP_HOUR=5 BACKUP_MAX=7 \
97+
BEPINEX=no BEPINEX_UPDATE=no \
98+
CHANGE_CONFIG_DIR_OWNERSHIP=YES \
99+
CPM=no CPM_UPDATE=no \
100+
DARKNESS_FALLS_URL=False DARKNESS_FALLS=no DARKNESS_FALLS_UPDATE=no \
101+
LINUXGSM_VERSION=v24.3.4 \
102+
PUID=1000 PGID=1000 \
103+
START_MODE=0 \
104+
TEST_ALERT=no MONITOR=no \
105+
UNDEAD_LEGACY=no UNDEAD_LEGACY_VERSION=stable UNDEAD_LEGACY_UPDATE=no UNDEAD_LEGACY_URL=False \
106+
UPDATE_MODS=no \
107+
VERSION=stable
108+
90109
# Remove default user ubuntu
91110
RUN deluser --remove-home ubuntu
92111

@@ -97,25 +116,12 @@ RUN adduser --home /home/sdtdserver --disabled-password --shell /bin/bash --disa
97116
#Set ulimit as recommended by the game.
98117
RUN echo 'sdtdserver soft nofile 10240' >> /etc/security/limits.conf
99118

100-
##Need use xterm for LinuxGSM##
101-
ENV PUID=1000 PGID=1000 \
102-
START_MODE=0 \
103-
TEST_ALERT=no MONITOR=no \
104-
BACKUP=no BACKUP_HOUR=5 BACKUP_MAX=7 \
105-
VERSION=stable \
106-
UPDATE_MODS=no \
107-
ALLOC_FIXES=no ALLOC_FIXES_UPDATE=no \
108-
UNDEAD_LEGACY=no UNDEAD_LEGACY_VERSION=stable UNDEAD_LEGACY_UPDATE=no UNDEAD_LEGACY_URL=False \
109-
CPM=no CPM_UPDATE=no \
110-
BEPINEX=no BEPINEX_UPDATE=no \
111-
CHANGE_CONFIG_DIR_OWNERSHIP=YES \
112-
DARKNESS_FALLS_URL=False DARKNESS_FALLS=no DARKNESS_FALLS_UPDATE=no
113-
114119
# Base dir
115120
WORKDIR /home/sdtdserver
116121

117122
# Download LinuxGSM scripts
118-
RUN wget -O linuxgsm.sh https://linuxgsm.sh && chmod +x linuxgsm.sh && su-exec sdtdserver bash linuxgsm.sh sdtdserver
123+
RUN git clone --depth 1 --branch $LINUXGSM_VERSION https://github.com/GameServerManagers/LinuxGSM.git
124+
RUN cp LinuxGSM/linuxgsm.sh linuxgsm.sh && chmod +x linuxgsm.sh && su-exec sdtdserver bash linuxgsm.sh sdtdserver
119125

120126
##############BASE IMAGE##############
121127

docs/parameters.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
| Parameter | Function |
66
| --- | --- |
77
| `/path/to/7DaysToDie:/home/sdtdserver/.local/share/7DaysToDie/` | 7DaysToDie saves, where maps are store. |
8-
| `/path/to/ServerFiles:/home/sdtdserver/serverfiles/` | 7DaysToDie server config files. |
9-
| `/path/to/Logs:/home/sdtdserver/log/` | 7DaysToDie server log files. |
108
| `/path/to/BackupFolder:/home/sdtdserver/lgsm/backup/` | 7DaysToDie server backups files. |
119
| `/path/to/LGSM-Config:/home/sdtdserver/lgsm/config-lgsm/sdtdserver/` | LGSM config files. [More info](https://docs.linuxgsm.com/commands/monitor) |
10+
| `/path/to/Logs:/home/sdtdserver/log/` | 7DaysToDie server log files. |
11+
| `/path/to/ServerFiles:/home/sdtdserver/serverfiles/` | 7DaysToDie server config files. |
1212

1313
## Ports
1414

@@ -26,12 +26,13 @@
2626

2727
| Parameter | Function | Values |
2828
| --- | --- | :---: |
29+
| `CHANGE_CONFIG_DIR_OWNERSHIP` | Disable chown of config dirs | [More info](parameters.md#directory-ownership) |
30+
| `LINUXGSM_VERSION=v24.3.4` | Allow to change LinuxGSM script version, you can use a tag or a branch | [More info](https://github.com/GameServerManagers/LinuxGSM/tags) |
31+
| `PGID=1000` | for GroupID | [More info](user_groups_identifiers.md) |
32+
| `PUID=1000` | for UserID | [More info](user_groups_identifiers.md) |
2933
| `START_MODE=1` | Start mode of the container **required** | [Start Modes](parameters.md#start-modes) |
3034
| `TimeZone=Europe/Madrid` | for TimeZone **recomendable**| [TZ Database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) |
31-
| `PUID=1000` | for UserID | [More info](user_groups_identifiers.md) |
32-
| `PGID=1000` | for GroupID | [More info](user_groups_identifiers.md) |
3335
| `--restart unless-stopped` | Restart container always unlesss stopped manually **NEVER USE WITH START_MODE=0, 2 or 4** | [Restart Policy](https://docs.docker.com/config/containers/start-containers-automatically/#use-a-restart-policy) |
34-
| `CHANGE_CONFIG_DIR_OWNERSHIP` | Disable chown of config dirs | [More info](parameters.md#directory-ownership)
3536

3637
## 7 Days to Die
3738

@@ -111,8 +112,8 @@
111112
| 3 | Update and start start |
112113
| 4 | Backup server and STOP the container |
113114

115+
### DIRECTORY OWNERSHIP
114116

115-
### DIRECTORY OWNERSHIP ###
116117
Sometimes if you're running some of your volumes on a NAS, you wont be the owner of the volumes you mount, and wont have access to change their ownership. This setting will bypass trying to change ownership, otherwise the startup will fail.
117118

118119
#### WARNING

docs/usage.md

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ services:
1111
image: vinanrra/7dtd-server
1212
container_name: 7dtdserver
1313
environment:
14+
- LINUXGSM_VERSION=v24.3.4 # Change to use another version of LinuxGSM
1415
- START_MODE=1 # Change between START MODES
1516
- VERSION=stable # Change between 7 days to die versions
1617
- PUID=1000 # Remember to use same as your user

install.sh

-7
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@ test_alert () {
1414
fi
1515
}
1616

17-
# Check requeriments
18-
19-
# Check if script is missing
20-
if [ ! -f sdtdserver ]; then
21-
source "$scriptsDir/check_script.sh"
22-
fi
23-
2417
# Check if server have been installed, if missing file
2518
if [ ! -f serverfiles/DONT_REMOVE.txt ]; then
2619
source "$scriptsDir/first_install.sh"

scripts/check_script.sh

-3
This file was deleted.

0 commit comments

Comments
 (0)