mirror of
https://github.com/RustyRaptor/planetary-annihilation-docker.git
synced 2026-12-03 19:45:15 -07:00
Add healthcheck
This commit is contained in:
1 parent
fabb9083e9
commit
0fa050f7bf
2 files changed
+16
No files matched your search
@@ -34,6 +34,7 @@ USER patuser
|
||||
# Get the server files
|
||||
COPY --from=downloader --chown=patuser /patserver/$PA_STREAM_NAME $INSTALL_LOC
|
||||
COPY --chown=patuser ./docker-entrypoint.sh /docker-entrypoint.sh
|
||||
COPY healthcheck.sh /healthcheck.sh
|
||||
|
||||
ENV PA_TITANS_ENABLED=yes
|
||||
ENV PA_AI_ENABLED=yes
|
||||
@@ -46,6 +47,7 @@ ENV PA_REPLAY_TIMEOUT=180
|
||||
ENV PA_GAMEOVER_TIMEOUT=360
|
||||
ENV PA_EMPTY_TIMEOUT=3600
|
||||
|
||||
HEALTHCHECK CMD /healthcheck.sh
|
||||
VOLUME $REPLAYS_LOC
|
||||
EXPOSE 20545
|
||||
WORKDIR $INSTALL_LOC
|
||||
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Based on https://stackoverflow.com/questions/9609130/efficiently-test-if-a-port-is-open-on-linux
|
||||
exec 6<>/dev/tcp/127.0.0.1/20545
|
||||
success=$?
|
||||
|
||||
exec 6>&- # close output connection
|
||||
exec 6<&- # close input connection
|
||||
|
||||
if [[ $? != 0 ]]; then
|
||||
exit 1
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
Reference in new issue
Block a user