You need to implement the Task Schedule operation inside the Docker container.
Objective : to implement the execution every minute in the "/ var / www / html" command "php artisan schedule: run --verbose --no-interaction".
Implementation options: it will still be cron or a separate script, the main thing is to work. There is already a container with php-fpm, I tried to implement the work of cron inside it, but there is not enough knowledge to cope with it.
I’ll make it clear: three days ago I learned what a docker is.
docker-compose.yml
version: '3.3' services: nginx: image: nginx:1.15.8-alpine container_name: nginx ports: - 8000:80 volumes: - ./etc/nginx/default.conf:/etc/nginx/conf.d/default.conf - ./web:/var/www/html - ./etc/nginx/default.template.conf:/etc/nginx/conf.d/default.template - ./etc/logs/nginx:/var/log/nginx environment: - NGINX_HOST=${NGINX_HOST} links: - php - mysqldb restart: always php: build: context: . dockerfile: ./etc/php/Dockerfile container_name: php volumes: - ./web:/var/www/html - ./etc/php/php.ini:/usr/local/etc/php/conf.d/php.ini links: - mysqldb restart: always mysqldb: image: mysql:${MYSQL_VERSION} container_name: ${MYSQL_HOST} ports: - 8989:3306 env_file: - web/.env environment: - MYSQL_DATABASE=${MYSQL_DATABASE} - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} - MYSQL_USER=${MYSQL_USER} - MYSQL_PASSWORD=${MYSQL_PASSWORD} volumes: - ./etc/db/mysql:/var/lib/mysql restart: always Dockerfile (php-fpm)
FROM php:7.2-fpm WORKDIR '/var/www/html' RUN apt-get update RUN apt-get install -y \ curl \ wget \ git \ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer RUN docker-php-ext-install pdo_mysql RUN echo "alias phinx='php src/vendor/bin/phinx'" >> ~/.bashrc