From 762f04fd1a553d4c09a8ad43859857e506b253b8 Mon Sep 17 00:00:00 2001 From: NaysKutzu Date: Sun, 24 Nov 2024 12:50:55 +0100 Subject: [PATCH] PUSH -> Add the cron jobs --- backend/Dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/Dockerfile b/backend/Dockerfile index 4dae0a2..c16726a 100755 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -14,6 +14,7 @@ RUN apt-get update && apt-get install -y \ zip \ unzip \ git \ + cron \ && docker-php-ext-configure gd --with-freetype --with-jpeg \ && docker-php-ext-install \ gd \ @@ -38,6 +39,11 @@ RUN COMPOSER_ALLOW_SUPERUSER=1 composer install --no-dev --optimize-autoloader # Copy rest of the application COPY . . +# Add a cron job +RUN (crontab -l ; echo "* * * * * cd /var/www/html/backend && php mythicaldash schedule:work >> /dev/null 2>&1") | crontab +RUN (crontab -l ; echo "* * * * * cd /var/www/html/backend/storage/cron && php runner.php >> /dev/null 2>&1") | crontab +RUN (crontab -l ; echo "* * * * * cd /var/www/html/backend/storage/cron && bash runner.php >> /dev/null 2>&1") | crontab + # Set permissions RUN chown -R www-data:www-data /var/www/html \ && chmod -R 755 /var/www/html \ No newline at end of file