fix: delay squadjs startup by 10 seconds

We have to wait until the Squad server is initialized and has a full
RCON connection up. This allows SquadJS to be started in tandem with a
Squad docker image in docker compose without conflict.

This is a bit hacky and a healthcheck would be superior, but there's a
lot of instances to check in the Squad log to even verify if the RCON
connection is good to go.

Another potential way of doing this health check is to attempt to login
into the rcon connection ourselves in a loop and then start SquadJS once
that rcon connection succeeds (after closing the RCON connection we
made).
This commit is contained in:
Price Hiller 2023-02-03 16:42:24 -06:00
parent 33f1201737
commit 5d4651c168
2 changed files with 8 additions and 1 deletions

View File

@ -44,4 +44,5 @@ FROM setup as prod
USER "${USER}"
WORKDIR "${USER_HOME}/SquadJS"
ENTRYPOINT ["/usr/bin/node", "./index.js"]
COPY ./scripts/entry.sh .
ENTRYPOINT ["/bin/sh", "entry.sh"]

6
scripts/entry.sh Normal file
View File

@ -0,0 +1,6 @@
#!/bin/sh
printf "Starting SquadJS...\n"
sleep 10
/usr/bin/node ./index.js