forked from wbstack/api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.sh
executable file
·37 lines (25 loc) · 845 Bytes
/
start.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
34
35
36
37
#!/usr/bin/env bash
set -e
role=${CONTAINER_ROLE:-app}
env=${APP_ENV:-production}
# if [ "$env" != "local" ]; then
# echo "Caching configuration..."
# (cd /var/www/html && php artisan config:cache && php artisan route:cache && php artisan view:cache)
# fi
if [ "$role" = "app" ]; then
exec apache2-foreground
elif [ "$role" = "queue" ] && [ "$HORIZON_ENABLED" = "1" ]; then
php /var/www/html/artisan horizon
elif [ "$role" = "queue" ]; then
echo "Running the $queue_name queue..."
php /var/www/html/artisan queue:work --verbose --tries=5 --timeout=90 --queue="$queue_name"
elif [ "$role" = "scheduler" ]; then
while [ true ]
do
php /var/www/html/artisan schedule:run --verbose --no-interaction &
sleep 60
done
else
echo "Could not match the container role \"$role\""
exit 1
fi