Compare commits
2 Commits
f844307418
...
58a035987f
Author | SHA1 | Date | |
---|---|---|---|
58a035987f | |||
|
5c4566f419 |
23
docker/init
23
docker/init
@ -31,17 +31,6 @@ function nginx_start() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function wait_for_db() {
|
|
||||||
# Wait for DB to be active
|
|
||||||
if [ -n "${DB_HOST}" -a -n "${DB_PORT}" ]; then
|
|
||||||
while ! wait-for-it -h ${DB_HOST} -p ${DB_PORT} -t 5 -q; do
|
|
||||||
echo "? Waiting for database at ${DB_HOST}:${DB_PORT}"
|
|
||||||
sleep 1;
|
|
||||||
done
|
|
||||||
echo "- DB is active on ${DB_HOST}:${DB_PORT}"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Run any container setup
|
# Run any container setup
|
||||||
[ -x /sbin/init-container ] && /sbin/init-container
|
[ -x /sbin/init-container ] && /sbin/init-container
|
||||||
|
|
||||||
@ -112,7 +101,13 @@ if [ -r artisan -a -e ${php}/.env ]; then
|
|||||||
# If DB_HOST not set, source the env file
|
# If DB_HOST not set, source the env file
|
||||||
[ -z "${DB_HOST}" -a -r .env ] && . .env
|
[ -z "${DB_HOST}" -a -r .env ] && . .env
|
||||||
|
|
||||||
wait_for_db
|
if [ -n "${DB_HOST}" -a -n "${DB_PORT}" ]; then
|
||||||
|
while ! wait-for-it -h ${DB_HOST} -p ${DB_PORT} -t 5 -q; do
|
||||||
|
echo "? Waiting for database at ${DB_HOST}:${DB_PORT}"
|
||||||
|
sleep 1;
|
||||||
|
done
|
||||||
|
echo "- DB is active on ${DB_HOST}:${DB_PORT}"
|
||||||
|
fi
|
||||||
|
|
||||||
su www-data -s /bin/sh -c "php artisan migrate" && rm -f .migrate
|
su www-data -s /bin/sh -c "php artisan migrate" && rm -f .migrate
|
||||||
fi
|
fi
|
||||||
@ -154,8 +149,6 @@ if [ -r artisan -a -e ${php}/.env ]; then
|
|||||||
# We'll delay starting in case the app is caching
|
# We'll delay starting in case the app is caching
|
||||||
sleep 15
|
sleep 15
|
||||||
|
|
||||||
wait_for_db
|
|
||||||
|
|
||||||
su www-data -s /bin/sh -c "
|
su www-data -s /bin/sh -c "
|
||||||
while true; do
|
while true; do
|
||||||
php ${PHP_OPTIONS} artisan queue:${QUEUE_CMD} --verbose --tries=${WORK_TRIES:-1} --timeout=${WORK_TIMEOUT:-90} ${WORK_QUEUES:+--queue=${WORK_QUEUES}} ${WORK_MEMORY:+--memory=${WORK_MEMORY}} ${WORK_ONCE:+--once}
|
php ${PHP_OPTIONS} artisan queue:${QUEUE_CMD} --verbose --tries=${WORK_TRIES:-1} --timeout=${WORK_TIMEOUT:-90} ${WORK_QUEUES:+--queue=${WORK_QUEUES}} ${WORK_MEMORY:+--memory=${WORK_MEMORY}} ${WORK_ONCE:+--once}
|
||||||
@ -169,7 +162,7 @@ if [ -r artisan -a -e ${php}/.env ]; then
|
|||||||
|
|
||||||
su www-data -s /bin/sh -c "
|
su www-data -s /bin/sh -c "
|
||||||
while true; do
|
while true; do
|
||||||
php ${PHP_OPTIONS} artisan schedule:work --verbose --no-interaction
|
(php ${PHP_OPTIONS} artisan schedule:work --verbose --no-interaction &)
|
||||||
done
|
done
|
||||||
"
|
"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user