-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathinit.sh
28 lines (22 loc) · 834 Bytes
/
init.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
if [ -z "$QUEUE_CONNECTION" ]; then
QUEUE_CONNECTION="redis"
fi
if [ -z "$QUEUE_NAME" ]; then
QUEUE_NAME="default"
fi
if [ -z "$LARAVEL_HORIZON" ]; then
LARAVEL_HORIZON=false
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
if [ "$LARAVEL_HORIZON" = "true" ] || [ "$LARAVEL_HORIZON" = "1" ] ; then
cp /etc/supervisor/conf.d/laravel-horizon.conf.tpl /etc/supervisor/supervisord.conf
else
sed -e "s~%%QUEUE_CONNECTION%%~$QUEUE_CONNECTION~" \
-e "s~%%QUEUE_NAME%%~$QUEUE_NAME~" \
-e "s~%%MEMORY_LIMIT%%~$PHP_MEMORY_LIMIT~" \
/etc/supervisor/conf.d/laravel-worker.conf.tpl > /etc/supervisor/supervisord.conf
fi
exec supervisord --nodaemon --configuration /etc/supervisor/supervisord.conf