diff --git a/.env.docker b/.env.docker index 8dc3ed5..bea9402 100644 --- a/.env.docker +++ b/.env.docker @@ -14,7 +14,7 @@ PHP_CLI_SERVER_WORKERS=4 BCRYPT_ROUNDS=12 -LOG_CHANNEL=stack +LOG_CHANNEL=stderr LOG_STACK=single LOG_DEPRECATIONS_CHANNEL=null LOG_LEVEL=debug diff --git a/Dockerfile b/Dockerfile index 557ffcd..6b2a5a5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,8 @@ RUN install-php-extensions \ RUN apt-get update && apt-get install -y \ supervisor \ cron \ - && rm -rf /var/lib/apt/lists/* + && rm -rf /var/lib/apt/lists/* \ + && mkdir -p /var/log/supervisor # Set up supervisor configuration COPY ./supervisor/ /etc/supervisor/conf.d/ diff --git a/entrypoint.sh b/entrypoint.sh index d0ccba3..6f94b7a 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -21,23 +21,23 @@ if [ -f "/app/hook.sh" ]; then /app/hook.sh fi -# Start supervisor services if enabled -if [ "$ENABLE_QUEUE_WORKER" = "true" ]; then - echo "Enabling Laravel queue worker..." - supervisorctl -c /etc/supervisor/conf.d/supervisord.conf update laravel-queue - supervisorctl -c /etc/supervisor/conf.d/supervisord.conf start laravel-queue:* -fi - -if [ "$ENABLE_SCHEDULER" = "true" ]; then - echo "Enabling Laravel scheduler..." - supervisorctl -c /etc/supervisor/conf.d/supervisord.conf update laravel-scheduler - supervisorctl -c /etc/supervisor/conf.d/supervisord.conf start laravel-scheduler:* -fi - # Start supervisor if any services are enabled if [ "$ENABLE_QUEUE_WORKER" = "true" ] || [ "$ENABLE_SCHEDULER" = "true" ]; then echo "Starting supervisor..." /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf & + + # Wait for supervisor to start + sleep 2 + + if [ "$ENABLE_QUEUE_WORKER" = "true" ]; then + echo "Starting Laravel queue worker..." + supervisorctl -c /etc/supervisor/conf.d/supervisord.conf start laravel-queue:* + fi + + if [ "$ENABLE_SCHEDULER" = "true" ]; then + echo "Starting Laravel scheduler..." + supervisorctl -c /etc/supervisor/conf.d/supervisord.conf start laravel-scheduler:* + fi fi # exec php /app/artisan octane:frankenphp