mirror of
https://github.com/craigerl/aprsd.git
synced 2025-09-05 14:47:53 -04:00
added healthcheck.sh
This commit is contained in:
parent
044ea4cc9a
commit
1054999568
@ -86,4 +86,4 @@ CMD ["server"]
|
|||||||
# USER appuser
|
# USER appuser
|
||||||
|
|
||||||
HEALTHCHECK --interval=1m --timeout=12s --start-period=30s \
|
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
22
docker/bin/healthcheck.sh
Executable 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}
|
Loading…
x
Reference in New Issue
Block a user