rash07/scheduling

By rash07

Updated almost 2 years ago

Cron service for Laravel App, composer & php installed

Image

10K+

PHP 8.2

Dockerfile

FROM rash07/php-fpm:8.2

RUN apt-get update && apt-get install -y cron

# Add docker custom crontab
ADD laravel-scheduling /etc/cron.d/laravel-scheduling

# Update the crontab file permission
RUN chmod 0644 /etc/cron.d/laravel-scheduling

# Specify crontab file for running
RUN crontab /etc/cron.d/laravel-scheduling

# Create the log file to be able to run tail
RUN touch /var/log/cron.log

# execute crontab
CMD ["cron", "-f"]

laravel-scheduling file example

* * * * * php /var/www/html/artisan schedule:run >> /dev/null 2>&1
* * * * * php /var/www/html/artisan tenancy:run schedule:run >> /dev/null 2>&1

docker-compose.yml file example

version: '3'

services:
    php:
        build: .
        image: rash07/scheduling:8.2
        working_dir: /var/www/html
        volumes:
            - ./:/var/www/html

Docker Pull Command

docker pull rash07/scheduling