1
0
mirror of https://github.com/craigerl/aprsd.git synced 2025-04-19 09:49:01 -04:00

added healthcheck.sh

This commit is contained in:
Hemna 2025-01-17 00:44:43 +00:00
parent 044ea4cc9a
commit 1054999568
2 changed files with 23 additions and 1 deletions

View File

@ -86,4 +86,4 @@ CMD ["server"]
# USER appuser
HEALTHCHECK --interval=1m --timeout=12s --start-period=30s \
CMD aprsd healthcheck --config /config/aprsd.conf --loglevel DEBUG
CMD uv run aprsd healthcheck --config /config/aprsd.conf --loglevel DEBUG

22
docker/bin/healthcheck.sh Executable file
View File

@ -0,0 +1,22 @@
#!/usr/bin/env bash
#
# This is the docker container healthcheck script
# It's assumed to be running in a working aprsd container.
set -x
source /app/.venv/bin/activate
if [ -z "${LOG_LEVEL}" ] || [[ ! "${LOG_LEVEL}" =~ ^(CRITICAL|ERROR|WARNING|INFO)$ ]]; then
LOG_LEVEL="DEBUG"
fi
echo "Log level is set to ${LOG_LEVEL}";
# check to see if there is a config file
APRSD_CONFIG="/config/aprsd.conf"
if [ ! -e "$APRSD_CONFIG" ]; then
echo "'$APRSD_CONFIG' File does not exist. Creating."
aprsd sample-config > $APRSD_CONFIG
fi
uv run aprsd healthcheck --config $APRSD_CONFIG --loglevel ${LOG_LEVEL}