health-check and migrate on boot (#25)
All checks were successful
ci/woodpecker/release/build_release/1 Pipeline was successful
ci/woodpecker/release/build_release/2 Pipeline was successful
ci/woodpecker/release/build_release/3 Pipeline was successful
ci/woodpecker/release/build_release/4 Pipeline was successful

add a health check to the container
and option to artisan migrate on boot

Co-authored-by: Ruben Momoa <ruben.lobbes@lobbes.nl>
Reviewed-on: #25
This commit was merged in pull request #25.
This commit is contained in:
2024-08-30 14:29:44 +02:00
parent 943c155122
commit 1c4212f709
4 changed files with 27 additions and 8 deletions

View File

@@ -3,6 +3,11 @@
# exit when any command fails
set -e
if [ ! -f /var/www/html/artisan ]; then
echo "No existing Laravel project found"
exit
fi
# install extra packages and extensions on first boot
if [[ $(id -u) -eq 0 && ! -f /etc/first_boot ]]; then
if [[ -n "${EXTRA_APK_PACKAGES// /}" ]]; then
@@ -26,9 +31,9 @@ if [[ "$BOOT_NPM_INSTALL" = true ]]; then
npm install --cache /tmp/npm
fi
if [ ! -f /var/www/html/artisan ]; then
echo "No existing Laravel project found"
exit
if [[ "$BOOT_MIGRATE" = true ]]; then
echo "artisan migrate"
php /var/www/html/artisan migrate
fi
if [[ "$BOOT_NPM_DEV" = true ]]; then