Docker configuration

This commit is contained in:
Vorezal 2026-01-31 17:53:26 +00:00
parent fc0b1a2505
commit 0d2d1b90c8
4 changed files with 71 additions and 1 deletions

26
entrypoint.sh Normal file
View file

@ -0,0 +1,26 @@
#!/usr/bin/env bash
# Exit immediately if a command exits with a non-zero status
set -e
# If the CRON_SCHEDULE and DOCKCHECK_ARGS environment variables are set, create the crontab entry for the dockcheck user
if [ -n "$CRON_SCHEDULE" ] && [ -n "$DOCKCHECK_ARGS" ]; then
# Write the environment variable content to a temporary file, ensuring a newline at the end
echo "$CRON_SCHEDULE" /app/dockcheck.sh "$DOCKCHECK_ARGS" > /app/crontab
# Support additional schedule variables
for schedule_var in "${!CRON_SCHEDULE_@}"; do
suffix="${schedule_var#CRON_SCHEDULE_}"
schedule_value="${!schedule_var}"
args_var="DOCKCHECK_ARGS_${suffix}"
args_value="${!args_var}"
echo "$schedule_value" /app/dockcheck.sh "$args_value" >> /app/crontab
done
echo "Crontab created."
else
echo "No CRON_SCHEDULE or DOCKCHECK_ARGS environment variable(s) found. No crontab created."
fi
# Pass control to the CMD command specified in the Dockerfile
exec "$@"