From 5f6269a40c1a93d468f10bce2b232b10f6e0dded Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=86=E3=82=AF=E3=83=8B=E3=82=AB=E3=83=AB=E8=AB=8F?= =?UTF-8?q?=E8=A8=AA=E5=AD=90?= Date: Sun, 6 Feb 2022 15:01:30 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=AF=E3=83=BC=E3=83=AD=E3=83=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 - infra/php/Dockerfile | 11 +---------- infra/php/crontab | 10 +++++----- 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 400ca828..f1aebb75 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,6 @@ php artisan storage:link #### 7.crontab(スケジューラー) ``` -echo "* * * * * cd /work && /usr/local/bin/php /work/artisan schedule:run >> /dev/null 2>&1" >> /var/spool/cron/crontabs/root service cron start ``` diff --git a/infra/php/Dockerfile b/infra/php/Dockerfile index 135af87c..9a7f3113 100644 --- a/infra/php/Dockerfile +++ b/infra/php/Dockerfile @@ -31,15 +31,6 @@ RUN docker-php-ext-configure gd --with-jpeg RUN docker-php-ext-install -j$(nproc) intl pdo_mysql zip bcmath gd exif COPY ./php.ini /usr/local/etc/php/php.ini -#RUN echo "* * * * * cd /work && /usr/local/bin/php artisan schedule:run >> /dev/null 2>&1" >> /var/spool/cron/crontabs/root -#COPY ./crontab /var/spool/cron/crontabs/root -#COPY ./crontab /etc/crontab -#RUN service cron start -#CMD [ "php", "artisan migrate:fresh --seed" ] -#CMD [ "cron", "-f" ] -#CMD ["cron"] -#RUN cron -f -l 2 - -#RUN cd /work && composer update && npm run prod && php artisan migrate:fresh --seed +COPY ./crontab /etc/crontab WORKDIR /work diff --git a/infra/php/crontab b/infra/php/crontab index ef2b37d5..044b05c0 100644 --- a/infra/php/crontab +++ b/infra/php/crontab @@ -15,8 +15,8 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin # | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat # | | | | | # * * * * * user-name command to be executed -17 * * * * root cd / && run-parts --report /etc/cron.hourly -25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ) -47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly ) -52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly ) -* * * * * root cd /work && /usr/local/bin/php artisan schedule:run >> /dev/null 2>&1 + 17 * * * * root cd / && run-parts --report /etc/cron.hourly + 25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ) + 47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly ) + 52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly ) + * * * * * root cd /work && /usr/local/bin/php /work/artisan schedule:run >> /dev/null 2>&1