Skip to content

Commit

Permalink
update composer.json
Browse files Browse the repository at this point in the history
  • Loading branch information
cmzz committed Mar 8, 2021
1 parent c996306 commit afcb831
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions docker/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

set -e

role=${CONTAINER_ROLE:-app}
env=${APP_ENV:-production}

if [ "$env" != "local" ]; then
echo "Caching configuration..."
(cd /var/www && php artisan config:cache && php artisan route:cache && php artisan view:cache)
fi

if [ "$role" = "worker" ]; then
echo "Running the queue..."
php /var/www/artisan queue:work --verbose --sleep=3 --tries=3 --daemon --timeout=90
elif [ "$role" = "scheduler" ]; then
while true
do
php /var/www/artisan schedule:run --verbose --no-interaction &
sleep 60
done
else
echo "Could not match the container role \"$role\""
exit 1
fi

0 comments on commit afcb831

Please sign in to comment.