mirror of
https://github.com/AsgardEternal/SquadDocker.git
synced 2024-09-28 09:24:22 -05:00
feat: working vanilla Squad server
Mods are untested
This commit is contained in:
commit
3ad9e0f92b
71
Dockerfile
Normal file
71
Dockerfile
Normal file
@ -0,0 +1,71 @@
|
||||
# syntax=docker/dockerfile:1.4
|
||||
FROM asgard.orion-technologies.io/steamcmd:1.0 AS build
|
||||
|
||||
LABEL maintainer="price@orion-technologies.io"
|
||||
|
||||
ARG steam_app_id=403240
|
||||
ARG steam_beta_app_id=774961
|
||||
ARG workshop_id=393380
|
||||
ARG steam_beta_password=""
|
||||
ARG steam_beta_branch=""
|
||||
ARG use_squad_beta=0
|
||||
ARG squad_mods="()"
|
||||
|
||||
ENV RCON_PASSWORD=""
|
||||
ENV SQUAD_SERVER_DIR="${USER_HOME}/Squad-Server"
|
||||
# Space delimited list of mod numbers that are built into the image, e.g. 101 202 303
|
||||
ENV GAMEPORT=7787 \
|
||||
QUERYPORT=27165 \
|
||||
RCONPORT=21114 \
|
||||
FIXEDMAXPLAYERS=98 \
|
||||
FIXEDMAXTICKRATE=40 \
|
||||
RANDOM=NONE
|
||||
|
||||
SHELL [ "/bin/bash", "-c" ]
|
||||
|
||||
RUN <<__EOR__
|
||||
|
||||
if (( use_squad_beta == 1 )); then
|
||||
# Install Squad from the Beta branch
|
||||
"${STEAM_CMD_INSTALL_DIR}/steamcmd.sh" \
|
||||
+force_install_dir "${SQUAD_SERVER_DIR}" \
|
||||
+login anonymous \
|
||||
+app_update ${steam_app_id} validate \
|
||||
-beta "${steam_beta_branch}" \
|
||||
-betapassword "${steam_beta_password}" \
|
||||
+quit
|
||||
else
|
||||
# Install Squad from the release version
|
||||
"${STEAM_CMD_INSTALL_DIR}/steamcmd.sh" \
|
||||
+force_install_dir "${SQUAD_SERVER_DIR}" \
|
||||
+login anonymous \
|
||||
+app_update ${steam_app_id} validate \
|
||||
+quit
|
||||
fi
|
||||
|
||||
# Install mods as part of image
|
||||
|
||||
declare -A squad_mods="${squad_mods}"
|
||||
for mod in "${squad_mods[@]}"; do
|
||||
"${STEAM_CMD_INSTALL_DIR}/steamcmd.sh" \
|
||||
+force_install_dir "${SQUAD_SERVER_DIR}" \
|
||||
+login anonymous \
|
||||
+workshop_download_item "${workshop_id}" "${mod}" \
|
||||
+quit
|
||||
|
||||
mv "${SQUAD_SERVER_DIR}/steamapps/workshop/content/${workshop_id}/${mod}" \
|
||||
"${SQUAD_SERVER_DIR}/SquadGame/Plugins/Mods/${mod}"
|
||||
done
|
||||
|
||||
|
||||
__EOR__
|
||||
|
||||
EXPOSE ${GAMEPORT}/udp \
|
||||
${QUERYPORT}/tcp \
|
||||
${QUERYPORT}/udp \
|
||||
${RCONPORT}/tcp \
|
||||
${RCONPORT}/udp
|
||||
|
||||
COPY ./scripts/entry.sh "/entry.sh"
|
||||
|
||||
ENTRYPOINT [ "/bin/bash", "/entry.sh" ]
|
19
scripts/entry.sh
Normal file
19
scripts/entry.sh
Normal file
@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
while read -r line; do
|
||||
if [[ "${line}" == Password=* ]]; then
|
||||
# Overwrites the password
|
||||
echo "${line//Password=*/Password="${RCON_PASSWORD}"}"
|
||||
elif [[ "${line}" == Port=* ]]; then
|
||||
# Overwrites the rcon port
|
||||
echo "${line//Port=*/Port="${RCONPORT}"}"
|
||||
else
|
||||
echo "${line}"
|
||||
fi
|
||||
done < "${SQUAD_SERVER_DIR}/SquadGame/ServerConfig/Rcon.cfg" > "rcon.temp" && mv "rcon.temp" "${SQUAD_SERVER_DIR}/SquadGame/ServerConfig/Rcon.cfg"
|
||||
|
||||
"${SQUAD_SERVER_DIR}/SquadGameServer.sh" \
|
||||
Port="${GAMEPORT}" \
|
||||
QueryPort="${QUERYPORT}" \
|
||||
FIXEDMAXTICKRATE="${FIXEDMAXTICKRATE}" \
|
||||
FIXEDMAXPLAYERS="${FIXEDMAXPLAYERS}"
|
Loading…
Reference in New Issue
Block a user