2023-01-25 17:48:46 -06:00
|
|
|
# syntax=docker/dockerfile:1.4
|
|
|
|
|
|
|
|
# hadolint global ignore=DL3003,DL3008
|
|
|
|
|
|
|
|
FROM debian:bullseye-slim AS setup
|
|
|
|
|
2023-02-12 17:31:49 -06:00
|
|
|
ARG squadjs_version="3.7.0"
|
2023-01-25 17:48:46 -06:00
|
|
|
|
|
|
|
ENV USER="squadjs"
|
|
|
|
ENV USER_HOME="/home/${USER}"
|
|
|
|
ENV SQUADJS_DIR="${USER_HOME}/SquadJS/"
|
|
|
|
|
|
|
|
COPY --chown=root:root --chmod=0744 ./scripts/prepare-node14-yarn.bash /root/prepare-node14-yarn.bash
|
|
|
|
SHELL [ "/bin/bash", "-c" ]
|
|
|
|
|
|
|
|
RUN <<__EOR__
|
|
|
|
printf "Creating user\n"
|
|
|
|
useradd -m "${USER}"
|
|
|
|
|
|
|
|
printf "Installing Prereqs\n"
|
|
|
|
/root/prepare-node14-yarn.bash
|
|
|
|
apt-get update
|
|
|
|
apt-get install -y --no-install-suggests --no-install-recommends \
|
|
|
|
yarn \
|
|
|
|
nodejs \
|
2023-01-25 20:45:50 -06:00
|
|
|
git=1:2.30.2-1 \
|
|
|
|
sqlite3=3.34.1-3
|
2023-01-25 17:48:46 -06:00
|
|
|
|
|
|
|
su "${USER}" - <<- __EOC__
|
|
|
|
(
|
2023-02-15 17:10:44 -06:00
|
|
|
git clone --depth 1 https://github.com/AsgardEternal/SquadJS.git "${USER_HOME}/SquadJS"
|
2023-01-25 17:48:46 -06:00
|
|
|
cd "${USER_HOME}/SquadJS" || exit 1
|
|
|
|
yarn install
|
|
|
|
yarn cache clean
|
|
|
|
)
|
|
|
|
__EOC__
|
|
|
|
|
|
|
|
apt-get remove git yarn
|
|
|
|
rm -rf /var/lib/apt/lists/* /root/prepare-node14-yarn.bash
|
|
|
|
|
|
|
|
__EOR__
|
|
|
|
|
|
|
|
FROM setup as prod
|
|
|
|
|
|
|
|
USER "${USER}"
|
|
|
|
WORKDIR "${USER_HOME}/SquadJS"
|
2023-02-03 16:42:24 -06:00
|
|
|
COPY ./scripts/entry.sh .
|
2023-02-13 05:36:32 -06:00
|
|
|
COPY ./squadjsPlugins/*.js "${USER_HOME}/SquadJS/squad-server/plugins/"
|
2023-02-03 16:42:24 -06:00
|
|
|
ENTRYPOINT ["/bin/sh", "entry.sh"]
|