diff --git a/README.md b/README.md index c25a763..82a0133 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,7 @@ It's like Laravel Homestead but for Docker instead of Vagrant. - [Production](#Production) - [Setup Laravel and Docker on Digital Ocean](#Digital-Ocean) - [Misc](#Misc) + - [Cron jobs](#CronJobs) - [Use custom Domain](#Use-custom-Domain) - [Enable Global Composer Build Install](#Enable-Global-Composer-Build-Install) - [Install Prestissimo](#Install-Prestissimo) @@ -936,6 +937,19 @@ To controll the behavior of xDebug (in the `php-fpm` Container), you can run the
+ + +### Adding cron jobs + +You can add your cron jobs to `workspace/crontab/root` after the `php artisan` line. + +``` +* * * * * php /var/www/laravel/artisan schedule:run >> /dev/null 2>&1 + +# Custom cron +* * * * * root echo "Every Minute" > /var/log/cron.log 2>&1 +``` + ### Use custom Domain (instead of the Docker IP) diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 303836c..c63f90b 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -198,6 +198,12 @@ RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = false ]; then \ rm /etc/php/7.0/cli/conf.d/aerospike.ini \ ;fi +##################################### +# Crontab +##################################### +USER root +COPY ./crontab /var/spool/cron/crontabs + # #-------------------------------------------------------------------------- # Final Touch diff --git a/workspace/crontab/root b/workspace/crontab/root new file mode 100644 index 0000000..c09ea2a --- /dev/null +++ b/workspace/crontab/root @@ -0,0 +1 @@ +* * * * * php /var/www/laravel/artisan schedule:run >> /dev/null 2>&1 \ No newline at end of file