Hopefully fix supervisor issue

This commit is contained in:
Javier Feliz 2025-08-02 19:43:34 -04:00
parent 3d7683c8ac
commit f18aa877a7
3 changed files with 16 additions and 15 deletions

View File

@ -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

View File

@ -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/

View File

@ -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