Skip to content

Commit

Permalink
feat: Allow to choose LinuxGSM version from github (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
vinanrra authored Jan 9, 2025
1 parent 379068d commit 9ce395b
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 55 deletions.
84 changes: 45 additions & 39 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,49 +9,54 @@ 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
##Need use xterm for LinuxGSM##
ENV DEBIAN_FRONTEND=noninteractive \
HOME=/home/sdtdserver \
LANG=en_US.utf8 \
TERM=xterm \
TimeZone=Europe/Madrid

#####Dependencies####

# LinuxGSM dependencies
RUN dpkg --add-architecture i386 && \
apt update -y && \
apt install -y --no-install-recommends \
nano \
iproute2 \
bc \
binutils \
bsdmainutils \
bzip2 \
ca-certificates \
cpio \
cron \
curl \
wget \
distro-info \
expect \
file \
bzip2 \
git \
gzip \
unzip \
unrar \
bsdmainutils \
python3 \
util-linux \
ca-certificates \
binutils \
bc \
iproute2 \
jq \
tmux \
lib32gcc-s1 \
lib32stdc++6 \
libgdiplus \
libsdl2-2.0-0:i386 \
libstdc++6 \
libstdc++6:i386 \
libxml2-utils \
telnet \
expect \
netcat-openbsd \
locales \
libgdiplus \
cron \
nano \
netcat-openbsd \
python3 \
tclsh \
cpio \
libsdl2-2.0-0:i386 \
xz-utils \
distro-info \
git \
telnet \
tmux \
unrar \
unzip \
util-linux \
uuid-runtime \
wget \
xz-utils \
pigz

# Install NodeJS
Expand Down Expand Up @@ -87,6 +92,20 @@ RUN apt clean && \

#####Dependencies####

ENV ALLOC_FIXES=no ALLOC_FIXES_UPDATE=no \
BACKUP=no BACKUP_HOUR=5 BACKUP_MAX=7 \
BEPINEX=no BEPINEX_UPDATE=no \
CHANGE_CONFIG_DIR_OWNERSHIP=YES \
CPM=no CPM_UPDATE=no \
DARKNESS_FALLS_URL=False DARKNESS_FALLS=no DARKNESS_FALLS_UPDATE=no \
LINUXGSM_VERSION=v24.3.4 \
PUID=1000 PGID=1000 \
START_MODE=0 \
TEST_ALERT=no MONITOR=no \
UNDEAD_LEGACY=no UNDEAD_LEGACY_VERSION=stable UNDEAD_LEGACY_UPDATE=no UNDEAD_LEGACY_URL=False \
UPDATE_MODS=no \
VERSION=stable

# Remove default user ubuntu
RUN deluser --remove-home ubuntu

Expand All @@ -97,25 +116,12 @@ RUN adduser --home /home/sdtdserver --disabled-password --shell /bin/bash --disa
#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
RUN git clone --depth 1 --branch $LINUXGSM_VERSION https://github.com/GameServerManagers/LinuxGSM.git
RUN cp LinuxGSM/linuxgsm.sh linuxgsm.sh && chmod +x linuxgsm.sh && su-exec sdtdserver bash linuxgsm.sh sdtdserver

##############BASE IMAGE##############

Expand Down
13 changes: 7 additions & 6 deletions docs/parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
| Parameter | Function |
| --- | --- |
| `/path/to/7DaysToDie:/home/sdtdserver/.local/share/7DaysToDie/` | 7DaysToDie saves, where maps are store. |
| `/path/to/ServerFiles:/home/sdtdserver/serverfiles/` | 7DaysToDie server config files. |
| `/path/to/Logs:/home/sdtdserver/log/` | 7DaysToDie server log files. |
| `/path/to/BackupFolder:/home/sdtdserver/lgsm/backup/` | 7DaysToDie server backups files. |
| `/path/to/LGSM-Config:/home/sdtdserver/lgsm/config-lgsm/sdtdserver/` | LGSM config files. [More info](https://docs.linuxgsm.com/commands/monitor) |
| `/path/to/Logs:/home/sdtdserver/log/` | 7DaysToDie server log files. |
| `/path/to/ServerFiles:/home/sdtdserver/serverfiles/` | 7DaysToDie server config files. |

## Ports

Expand All @@ -26,12 +26,13 @@

| Parameter | Function | Values |
| --- | --- | :---: |
| `CHANGE_CONFIG_DIR_OWNERSHIP` | Disable chown of config dirs | [More info](parameters.md#directory-ownership) |
| `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) |
| `PGID=1000` | for GroupID | [More info](user_groups_identifiers.md) |
| `PUID=1000` | for UserID | [More info](user_groups_identifiers.md) |
| `START_MODE=1` | Start mode of the container **required** | [Start Modes](parameters.md#start-modes) |
| `TimeZone=Europe/Madrid` | for TimeZone **recomendable**| [TZ Database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) |
| `PUID=1000` | for UserID | [More info](user_groups_identifiers.md) |
| `PGID=1000` | for GroupID | [More info](user_groups_identifiers.md) |
| `--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) |
| `CHANGE_CONFIG_DIR_OWNERSHIP` | Disable chown of config dirs | [More info](parameters.md#directory-ownership)

## 7 Days to Die

Expand Down Expand Up @@ -111,8 +112,8 @@
| 3 | Update and start start |
| 4 | Backup server and STOP the container |

### DIRECTORY OWNERSHIP

### DIRECTORY OWNERSHIP ###
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.

#### WARNING
Expand Down
1 change: 1 addition & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ services:
image: vinanrra/7dtd-server
container_name: 7dtdserver
environment:
- LINUXGSM_VERSION=v24.3.4 # Change to use another version of LinuxGSM
- START_MODE=1 # Change between START MODES
- VERSION=stable # Change between 7 days to die versions
- PUID=1000 # Remember to use same as your user
Expand Down
7 changes: 0 additions & 7 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ test_alert () {
fi
}

# Check requeriments

# Check if script is missing
if [ ! -f sdtdserver ]; then
source "$scriptsDir/check_script.sh"
fi

# Check if server have been installed, if missing file
if [ ! -f serverfiles/DONT_REMOVE.txt ]; then
source "$scriptsDir/first_install.sh"
Expand Down
3 changes: 0 additions & 3 deletions scripts/check_script.sh

This file was deleted.

0 comments on commit 9ce395b

Please sign in to comment.