Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ENV QUEUE_CONNECTION=redis
ENV QUEUE_NAME=default
ENV LARAVEL_HORIZON=false

RUN apk add --no-cache coreutils sqlite-dev libxml2-dev curl-dev gmp-dev icu-dev libpng-dev jpeg-dev freetype-dev autoconf imagemagick-dev gcc libc-dev libzip-dev rabbitmq-c-dev make libtool \
RUN apk add --no-cache coreutils sqlite-dev libxml2-dev curl-dev gmp-dev icu-dev libpng-dev jpeg-dev freetype-dev autoconf imagemagick-dev gcc libc-dev libzip-dev rabbitmq-c-dev make libtool samba-client \
&& docker-php-ext-configure gd --with-freetype=/usr/include/freetype2 --with-jpeg=/usr/include \
&& docker-php-ext-install -j$(nproc) bcmath pdo pdo_mysql pdo_sqlite json xml zip curl gmp intl gd soap sockets pcntl \
&& pecl install imagick \
Expand Down
5 changes: 5 additions & 0 deletions init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ if [ -z "$LARAVEL_HORIZON" ]; then
LARAVEL_HORIZON=false
fi

if [ -z "$NUMPROCS" ]; then
NUMPROCS=1
fi

PHP_MEMORY_LIMIT=${PHP_MEMORY_LIMIT:-512}
sed -e "s~%%MEMORY_LIMIT%%~${PHP_MEMORY_LIMIT}m~" \
/opt/etc/custom-php.ini.tpl > /usr/local/etc/php/conf.d/custom-php.ini
Expand All @@ -22,6 +26,7 @@ else
sed -e "s~%%QUEUE_CONNECTION%%~$QUEUE_CONNECTION~" \
-e "s~%%QUEUE_NAME%%~$QUEUE_NAME~" \
-e "s~%%MEMORY_LIMIT%%~$PHP_MEMORY_LIMIT~" \
-e "s~%%NUMPROCS%%~$NUMPROCS~" \
/etc/supervisor/conf.d/laravel-worker.conf.tpl > /etc/supervisor/supervisord.conf
fi

Expand Down
2 changes: 1 addition & 1 deletion laravel-worker.conf.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ process_name=%(program_name)s_%(process_num)02d
command=php /var/www/app/artisan queue:work %%QUEUE_CONNECTION%% --queue=%%QUEUE_NAME%% --memory=%%MEMORY_LIMIT%%
autostart=true
autorestart=true
numprocs=1
numprocs=%%NUMPROCS%%
startretries=10
stdout_events_enabled=1
redirect_stderr=true
Expand Down