Created
October 17, 2019 16:55
-
-
Save Spittal/7452ad7ecd91c6d590b0b75005daf1a0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Dockerfile | |
FROM sbvr/laravel-alpine | |
# Cron Scheudler conf https://laravel.com/docs/5.4/scheduling#introduction | |
COPY schedule-cron /var/spool/cron/crontabs/root | |
RUN chmod +x /var/spool/cron/crontabs/root | |
COPY cron.ini /etc/supervisor.d/ | |
CMD [ "supervisord", "-n" ] | |
// schedule-cron (crontab) | |
#!/bin/sh | |
* * * * * php /var/www/html/artisan schedule:run >> /dev/stdout 2>&1 | |
// cron.ini (supervisor conf for cron) | |
[program:cron] | |
process_name=%(program_name)s | |
command=crond -f | |
autostart=true | |
autorestart=true | |
stdout_logfile=/dev/stdout | |
stdout_logfile_maxbytes=0 | |
stderr_logfile=/dev/stderr | |
stderr_logfile_maxbytes=0 | |
[program:forward_logs] | |
process_name=%(program_name)s | |
command=ln -sf /proc/1/fd/1 /var/www/html/storage/logs/cron.log | |
stdout_logfile=/dev/stdout | |
stdout_logfile_maxbytes=0 | |
stderr_logfile=/dev/stderr | |
stderr_logfile_maxbytes=0 | |
startsecs=0 | |
priority=999 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment