init: cron job
This commit is contained in:
parent
ff50b04d09
commit
1a3a306db5
|
@ -10,3 +10,6 @@
|
||||||
###< symfony/framework-bundle ###
|
###< symfony/framework-bundle ###
|
||||||
|
|
||||||
/.idea/
|
/.idea/
|
||||||
|
|
||||||
|
/supervisord.log
|
||||||
|
/supervisord.pid
|
||||||
|
|
|
@ -33,7 +33,8 @@ services:
|
||||||
container_name: php-fpm
|
container_name: php-fpm
|
||||||
volumes:
|
volumes:
|
||||||
- ./:/app
|
- ./:/app
|
||||||
- ./docker/php-fpm/php.ini:/usr/local/etc/php/php.ini
|
- ./docker/php-fpm/php.ini:/usr/local/etc/php/php.ini:ro
|
||||||
|
- ./docker/php-fpm/supervisord.conf:/etc/supervisord.conf:ro
|
||||||
links:
|
links:
|
||||||
- mysql
|
- mysql
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,11 @@
|
||||||
FROM php:8.3-fpm
|
FROM php:8.3-fpm-alpine3.20
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN apk add supervisor
|
||||||
|
|
||||||
RUN docker-php-ext-install pdo pdo_mysql
|
RUN docker-php-ext-install pdo pdo_mysql
|
||||||
|
|
||||||
|
COPY crontab.txt /etc/cron.d/update-users
|
||||||
|
RUN cat /etc/cron.d/update-users >> /etc/crontabs/root
|
||||||
|
|
||||||
|
CMD [ "/usr/bin/supervisord", "-c", "/etc/supervisord.conf" ]
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
*/15 * * * * /app/bin/console app:update-all-users-cron
|
|
@ -0,0 +1,17 @@
|
||||||
|
[supervisord]
|
||||||
|
nodaemon=true
|
||||||
|
|
||||||
|
[program:cron]
|
||||||
|
command=/usr/bin/env sh -c "crond -f"
|
||||||
|
stdout_logfile=/var/log/cron
|
||||||
|
stderr_logfile=/var/log/cron.stderr
|
||||||
|
stdout_logfile_maxbytes=0
|
||||||
|
stderr_logfile_maxbytes=0
|
||||||
|
autorestart=true
|
||||||
|
|
||||||
|
[program:php-fpm]
|
||||||
|
command=docker-php-entrypoint php-fpm
|
||||||
|
stdout_logfile=/dev/stdout
|
||||||
|
stderr_logfile=/dev/stderr
|
||||||
|
stdout_logfile_maxbytes=0
|
||||||
|
stderr_logfile_maxbytes=0
|
Loading…
Reference in New Issue