From 868b70f530325d2404ba9232d9f0e29658445edb Mon Sep 17 00:00:00 2001 From: Saeed Vaziry Date: Wed, 17 Apr 2024 17:14:12 +0200 Subject: [PATCH] add cron to docker --- docker/Dockerfile | 4 +++- docker/start.sh | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index e6fed5c..634c292 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -19,7 +19,7 @@ RUN apt-get install -y nginx # php RUN apt-get update \ - && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor libcap2-bin libpng-dev \ + && apt-get install -y cron gnupg gosu curl ca-certificates zip unzip git supervisor libcap2-bin libpng-dev \ python2 dnsutils librsvg2-bin fswatch wget \ && add-apt-repository ppa:ondrej/php -y \ && apt-get update \ @@ -44,6 +44,8 @@ RUN rm /etc/nginx/sites-enabled/default COPY docker/nginx.conf /etc/nginx/sites-available/default RUN ln -s /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default +RUN echo "* * * * * cd /var/www/html && php artisan schedule:run >> /var/log/cron.log 2>&1" | crontab - + # supervisord COPY docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf diff --git a/docker/start.sh b/docker/start.sh index 23299bb..634d0f9 100644 --- a/docker/start.sh +++ b/docker/start.sh @@ -37,6 +37,8 @@ php /var/www/html/artisan view:cache php /var/www/html/artisan user:create "$NAME" "$EMAIL" "$PASSWORD" +cron + echo "Vito is running! 🚀" /usr/bin/supervisord