diff --git a/.examples/docker/docker-compose-local.yml b/.examples/docker/docker-compose-local.yml index f34a8d2..a0cc1f2 100644 --- a/.examples/docker/docker-compose-local.yml +++ b/.examples/docker/docker-compose-local.yml @@ -22,8 +22,7 @@ services: cron: image: librebooking/librebooking:4.1.0 restart: always - user: root - entrypoint: /usr/local/bin/cron.sh + command: supercronic /config/lb-jobs-cron depends_on: - app volumes: diff --git a/.examples/docker/docker-compose-public.yml b/.examples/docker/docker-compose-public.yml index f58bbfa..8604037 100644 --- a/.examples/docker/docker-compose-public.yml +++ b/.examples/docker/docker-compose-public.yml @@ -58,8 +58,7 @@ services: restart: always depends_on: - lb1 - user: root - entrypoint: /usr/local/bin/cron.sh + command: supercronic /config/lb-jobs-cron volumes: - lb1_conf:/config env_file: @@ -89,8 +88,7 @@ services: restart: always depends_on: - lb2 - user: root - entrypoint: /usr/local/bin/cron.sh + command: supercronic /config/lb-jobs-cron volumes: - lb2_conf:/config env_file: diff --git a/Dockerfile b/Dockerfile index 3fbad93..c0f50bd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,6 +21,16 @@ fi rm -rf .git EORUN +# Build supercronic +FROM golang:trixie AS supercronic +ADD https://github.com/aptible/supercronic.git#v0.2.44 src +WORKDIR /go/src +RUN <&2 "error: both $var and $fileVar are set (but are exclusive)" - exit 1 - fi - if [ -n "${varValue}" ]; then - export "$var"="${varValue}" - elif [ -n "${fileVarValue}" ]; then - export "$var"="$(cat "${fileVarValue}")" - elif [ -n "${def}" ]; then - export "$var"="$def" - fi - unset "$fileVar" -} - -# Initialize variables -file_env LB_DB_USER_PWD - -LB_LOGGING_FOLDER=${LB_LOGGING_FOLDER:-${DFT_LOGGING_FLR}} -LB_LOGGING_LEVEL=${LB_LOGGING_LEVEL:-${DFT_LOGGING_LEVEL}} -LB_LOGGING_SQL=${LB_LOGGING_SQL:-${DFT_LOGGING_SQL}} -APP_PATH=${APP_PATH:-${DFT_APP_PATH}} - -# Set the php timezone file -if [ -f /usr/share/zoneinfo/"${LB_DEFAULT_TIMEZONE}" ]; then - INI_FILE="/usr/local/etc/php/conf.d/librebooking.ini" - echo "[Date]" >>${INI_FILE} - echo "date.timezone=\"${LB_DEFAULT_TIMEZONE}\"" >>${INI_FILE} -fi - -# Link the configuration file -if ! [ -f /var/www/html/config/config.php ]; then - ln -s /config/config.php /var/www/html/config/config.php -fi - -# Load cron jobs under user www-data -crontab -u www-data /config/lb-jobs-cron - -# Switch to cron -exec /usr/sbin/cron -f -L 5 diff --git a/lb-jobs-cron b/lb-jobs-cron index 398d0f0..a7ab46e 100644 --- a/lb-jobs-cron +++ b/lb-jobs-cron @@ -1,6 +1,6 @@ -* * * * * /usr/local/bin/php -f /var/www/html/Jobs/autorelease.php > /dev/stdout 2>&1 -* * * * * /usr/local/bin/php -f /var/www/html/Jobs/sendmissedcheckin.php > /dev/stdout 2>&1 -* * * * * /usr/local/bin/php -f /var/www/html/Jobs/sendreminders.php > /dev/stdout 2>&1 -0 0 * * * /usr/local/bin/php -f /var/www/html/Jobs/sendseriesend.php > /dev/stdout 2>&1 -* * * * * /usr/local/bin/php -f /var/www/html/Jobs/sendwaitlist.php > /dev/stdout 2>&1 -0 0 * * * /usr/local/bin/php -f /var/www/html/Jobs/sessioncleanup.php > /dev/stdout 2>&1 +* * * * * /usr/local/bin/php -f /var/www/html/Jobs/autorelease.php +* * * * * /usr/local/bin/php -f /var/www/html/Jobs/sendmissedcheckin.php +* * * * * /usr/local/bin/php -f /var/www/html/Jobs/sendreminders.php +0 0 * * * /usr/local/bin/php -f /var/www/html/Jobs/sendseriesend.php +* * * * * /usr/local/bin/php -f /var/www/html/Jobs/sendwaitlist.php +0 0 * * * /usr/local/bin/php -f /var/www/html/Jobs/sessioncleanup.php diff --git a/setup.sh b/setup.sh index 8462b8b..2308619 100644 --- a/setup.sh +++ b/setup.sh @@ -12,7 +12,6 @@ set -x apt-get update apt-get upgrade --yes apt-get install --yes --no-install-recommends \ - cron \ libjpeg-dev \ libldap-dev \ libpng-dev \