diff --git a/composer.json b/composer.json index 17a882fc9..f4b66080c 100644 --- a/composer.json +++ b/composer.json @@ -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, } } diff --git a/docker/7.4/supervisord.conf b/docker/7.4/supervisord.conf index aaccf41fc..a3b42f623 100644 --- a/docker/7.4/supervisord.conf +++ b/docker/7.4/supervisord.conf @@ -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 \ No newline at end of file +[include] +files=/var/www/html/supervisord/*.conf \ No newline at end of file diff --git a/docker/8.0/Dockerfile b/docker/8.0/Dockerfile index 096adad92..147700d17 100644 --- a/docker/8.0/Dockerfile +++ b/docker/8.0/Dockerfile @@ -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"] diff --git a/docker/8.0/supervisord.conf b/docker/8.0/supervisord.conf index 9d2847958..a3b42f623 100644 --- a/docker/8.0/supervisord.conf +++ b/docker/8.0/supervisord.conf @@ -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 \ No newline at end of file diff --git a/docker/8.1/Dockerfile b/docker/8.1/Dockerfile index 0277709f1..3c055802a 100644 --- a/docker/8.1/Dockerfile +++ b/docker/8.1/Dockerfile @@ -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"] diff --git a/docker/8.1/scheduler b/docker/8.1/scheduler new file mode 100644 index 000000000..69e95f100 --- /dev/null +++ b/docker/8.1/scheduler @@ -0,0 +1 @@ +* * * * * root cd /var/www/html && php artisan schedule:run >> /dev/null 2>&1 diff --git a/docker/8.1/supervisord.conf b/docker/8.1/supervisord.conf index 9d2847958..a3b42f623 100644 --- a/docker/8.1/supervisord.conf +++ b/docker/8.1/supervisord.conf @@ -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 \ No newline at end of file diff --git a/supervisord/cron.conf b/supervisord/cron.conf new file mode 100644 index 000000000..1d1bbba5d --- /dev/null +++ b/supervisord/cron.conf @@ -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 diff --git a/supervisord/horizon.conf b/supervisord/horizon.conf deleted file mode 100644 index 7a4f9d46a..000000000 --- a/supervisord/horizon.conf +++ /dev/null @@ -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 \ No newline at end of file