2023-01-08 10:43:06 -06:00
|
|
|
# syntax=docker/dockerfile:1.4
|
2023-01-14 15:22:29 -06:00
|
|
|
|
|
|
|
# hadolint global ignore=DL3003,DL3008
|
|
|
|
|
2024-02-08 12:33:30 -06:00
|
|
|
FROM asgard-eternal.com/steamcmd:latest AS build-squad
|
2023-01-08 10:43:06 -06:00
|
|
|
LABEL maintainer="price@orion-technologies.io"
|
|
|
|
|
2023-01-12 02:24:46 -06:00
|
|
|
ARG steam_app_id=403240
|
|
|
|
ARG steam_beta_app_id=774961
|
|
|
|
ARG steam_beta_password=""
|
|
|
|
ARG steam_beta_branch=""
|
|
|
|
ARG use_squad_beta=0
|
2023-01-08 10:43:06 -06:00
|
|
|
|
|
|
|
ENV RCON_PASSWORD=""
|
|
|
|
ENV SQUAD_SERVER_DIR="${USER_HOME}/Squad-Server"
|
|
|
|
ENV GAMEPORT=7787 \
|
|
|
|
QUERYPORT=27165 \
|
|
|
|
RCONPORT=21114 \
|
|
|
|
FIXEDMAXPLAYERS=98 \
|
2023-12-12 14:34:43 -06:00
|
|
|
BEACONPORT=15000 \
|
2024-01-09 14:14:57 -06:00
|
|
|
FIXEDMAXTICKRATE=45 \
|
2023-01-08 10:43:06 -06:00
|
|
|
RANDOM=NONE
|
|
|
|
|
2023-01-12 02:24:46 -06:00
|
|
|
|
|
|
|
SHELL [ "/bin/bash", "-c" ]
|
2023-01-11 05:29:16 -06:00
|
|
|
|
|
|
|
RUN <<__EOR__
|
|
|
|
apt-get update
|
2023-01-14 13:32:25 -06:00
|
|
|
|
2023-01-11 05:29:16 -06:00
|
|
|
apt-get install -y --no-install-suggests --no-install-recommends \
|
2024-06-24 14:53:33 -05:00
|
|
|
lsb-release=12.0-1 \
|
|
|
|
apt-transport-https=2.6.1 \
|
|
|
|
gnupg=2.2.40-1.1
|
2023-01-14 13:32:25 -06:00
|
|
|
|
2023-01-14 15:22:29 -06:00
|
|
|
rm -rf /var/lib/apt/lists/*
|
2024-07-17 04:01:46 -05:00
|
|
|
__EOR__
|
2023-01-11 05:29:16 -06:00
|
|
|
|
2024-06-24 16:20:16 -05:00
|
|
|
# HACK: Hard coding the user to be "steam" is not great, but I'm too lazy to really do this the
|
|
|
|
# *right* way (which is making sure the USER ends up as steam via an entry point up in the steamcmd
|
|
|
|
# image). For now, this will have to do.
|
2024-07-17 04:01:46 -05:00
|
|
|
USER steam
|
|
|
|
|
|
|
|
RUN <<__EOR__
|
2023-01-12 02:24:46 -06:00
|
|
|
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
|
2023-01-14 16:34:49 -06:00
|
|
|
__EOR__
|
|
|
|
|
|
|
|
FROM build-squad AS mods
|
|
|
|
|
|
|
|
ARG workshop_id=393380
|
|
|
|
ARG mods=""
|
|
|
|
|
|
|
|
SHELL [ "/bin/bash", "-c" ]
|
|
|
|
|
|
|
|
RUN <<__EOR__
|
2023-01-12 02:24:46 -06:00
|
|
|
# Install mods as part of image
|
|
|
|
printf "Provided mods list: %s\n" "${mods}"
|
|
|
|
IFS="," read -ra squad_mods <<< "${mods}"
|
|
|
|
for mod in "${squad_mods[@]}"; do
|
|
|
|
printf "\n\n######\nAdding mod: %s\n######\n\n" "${mod}"
|
|
|
|
counter=0
|
|
|
|
until "${STEAM_CMD_INSTALL_DIR}/steamcmd.sh" \
|
|
|
|
+force_install_dir "${SQUAD_SERVER_DIR}/steamapps/workshop/content/${workshop_id}/${mod}" \
|
|
|
|
+login anonymous \
|
2024-07-10 00:18:46 -05:00
|
|
|
+workshop_download_item "${workshop_id}" "${mod}" validate \
|
2023-01-12 02:24:46 -06:00
|
|
|
+quit; do
|
|
|
|
printf "\nDid Not Fully Download %s, making another attempt.\n" "${mod}"
|
|
|
|
(( counter++ ))
|
|
|
|
if (( counter > 5 )); then
|
|
|
|
printf "Critical failure, could not download the mod: %s\n" "${mod}"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
# Link the mod instead of moving it into place, this allows steamcmd to update the mod in place if for whatever
|
|
|
|
# reason that becomes necessary. In reality nightly builds/builds via CI should update these mods. More of a nicety
|
|
|
|
# than something necessary.
|
|
|
|
ln -s "${SQUAD_SERVER_DIR}/steamapps/workshop/content/${workshop_id}/${mod}" "${SQUAD_SERVER_DIR}/SquadGame/Plugins/Mods/${mod}"
|
|
|
|
done
|
2023-01-11 05:29:16 -06:00
|
|
|
|
2023-01-14 15:22:29 -06:00
|
|
|
__EOR__
|
|
|
|
|
|
|
|
|
2023-01-25 17:58:59 -06:00
|
|
|
FROM mods AS prod
|
2023-01-08 20:05:40 -06:00
|
|
|
WORKDIR "${USER_HOME}"
|
2023-01-14 15:22:29 -06:00
|
|
|
COPY --chown=${USER}:${USER} --chmod=0744 ./scripts/entry.bash "${USER_HOME}/entry.bash"
|
2023-01-08 20:05:40 -06:00
|
|
|
|
2023-01-14 15:22:29 -06:00
|
|
|
EXPOSE \
|
2023-01-14 13:32:25 -06:00
|
|
|
7787/udp \
|
|
|
|
7787/tcp \
|
|
|
|
7788/udp \
|
|
|
|
7788/tcp \
|
2023-01-12 02:24:46 -06:00
|
|
|
27165/tcp \
|
|
|
|
27165/udp \
|
|
|
|
21114/tcp \
|
2023-12-12 14:17:08 -06:00
|
|
|
21114/udp \
|
2023-12-20 15:47:03 -06:00
|
|
|
15000/udp
|
2023-01-08 22:44:40 -06:00
|
|
|
|
2024-07-19 00:53:17 -05:00
|
|
|
# HACK: This shouldn't be done either! The entry.bash requires the root user though for certain tasks :(
|
|
|
|
USER root
|
2023-01-14 16:34:49 -06:00
|
|
|
ENTRYPOINT [ "/bin/bash", "entry.bash" ]
|