forked from ipunkt/docker-laravel-queue-worker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.sh
33 lines (26 loc) · 863 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
29
30
31
32
33
#!/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
if [ -z "$LARAVEL_HOME" ]; then
LARAVEL_HOME = "/var/www"
fi
if [ "$LARAVEL_HORIZON" = false ]; then
sed -e "s~%%QUEUE_CONNECTION%%~$QUEUE_CONNECTION~" \
-e "s~%%QUEUE_NAME%%~$QUEUE_NAME~" \
-e "s~%%WWWHOME%%~$LARAVEL_HOME~" \
/etc/supervisor/conf.d/laravel-worker.conf.tpl > /etc/supervisor/supervisord.conf
fi
if [ "$LARAVEL_HORIZON" = true ]; then
sed -e "s~%%QUEUE_CONNECTION%%~$QUEUE_CONNECTION~" \
-e "s~%%QUEUE_NAME%%~$QUEUE_NAME~" \
-e "s~%%WWWHOME%%~$LARAVEL_HOME~" \
/etc/supervisor/conf.d/laravel-horizon.conf.tpl > /etc/supervisor/supervisord.conf
fi
supervisord --nodaemon --configuration /etc/supervisor/supervisord.conf