This commit is contained in:
Mostafa Moradi 2022-06-09 15:24:20 +03:00
parent 962c57ec2c
commit 211c70d654
9 changed files with 29 additions and 29 deletions

View File

@ -94,9 +94,7 @@
"visiosoft/base-theme": "^1.0",
"visiosoft/advs-module": "^1.0",
"visiosoft/json-field_type": "^1.0",
"visiosoft/language_switcher-plugin": "^1.0",
"predis/predis": "^2.0",
"laravel/horizon": "^5.9"
"visiosoft/language_switcher-plugin": "^1.0"
},
"replace": {
"anomaly/streams-platform": "*"
@ -152,6 +150,6 @@
"config": {
"bin-dir": "bin",
"preferred-install": "dist",
"optimize-autoloader": true
"optimize-autoloader": true,
}
}

View File

@ -13,18 +13,5 @@ stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
[program:cron]
command=/usr/sbin/cron -f -l 8
autostart=true
stdout_logfile=/var/log/cron.out.log
stderr_logfile=/var/log/cron.err.log
[program:horizon]
process_name=%(program_name)s
command=php /var/www/html/artisan horizon
autostart=true
autorestart=true
user=sail
redirect_stderr=true
stdout_logfile=/var/www/html/storage/logs/horizon.log
stopwaitsecs=3600
[include]
files=/var/www/html/supervisord/*.conf

View File

@ -43,9 +43,11 @@ RUN apt-get update \
&& apt-get install -y yarn \
&& apt-get install -y mysql-client \
&& apt-get install -y postgresql-client-$POSTGRES_VERSION \
&& apt-get update \
&& apt-get install -y cron \
&& apt-get -y autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
RUN update-alternatives --set php /usr/bin/php8.0
@ -59,6 +61,11 @@ COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY php.ini /etc/php/8.0/cli/conf.d/99-sail.ini
RUN chmod +x /usr/local/bin/start-container
COPY scheduler /etc/cron.d/scheduler
RUN chmod +x /etc/cron.d/scheduler
RUN crontab /etc/cron.d/scheduler
EXPOSE 8000
ENTRYPOINT ["start-container"]

View File

@ -12,3 +12,6 @@ stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
[include]
files=/var/www/html/supervisord/*.conf

View File

@ -58,6 +58,11 @@ COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY php.ini /etc/php/8.1/cli/conf.d/99-sail.ini
RUN chmod +x /usr/local/bin/start-container
COPY scheduler /etc/cron.d/scheduler
RUN chmod +x /etc/cron.d/scheduler
RUN crontab /etc/cron.d/scheduler
EXPOSE 8000
ENTRYPOINT ["start-container"]

1
docker/8.1/scheduler Normal file
View File

@ -0,0 +1 @@
* * * * * root cd /var/www/html && php artisan schedule:run >> /dev/null 2>&1

View File

@ -12,3 +12,6 @@ stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
[include]
files=/var/www/html/supervisord/*.conf

5
supervisord/cron.conf Normal file
View File

@ -0,0 +1,5 @@
[program:cron]
command=/usr/sbin/cron -f -l 8
autostart=true
stdout_logfile=/var/log/cron.out.log
stderr_logfile=/var/log/cron.err.log

View File

@ -1,9 +0,0 @@
[program:horizon]
process_name=%(program_name)s
command=php /var/www/html/artisan horizon
autostart=true
autorestart=true
user=sail
redirect_stderr=true
stdout_logfile=/var/www/html/storage/logs/horizon.log
stopwaitsecs=3600