diff --git a/.env.example b/.env.example index 8b1213a..cf1f8b3 100644 --- a/.env.example +++ b/.env.example @@ -1,8 +1,14 @@ # the laravel version to install (empty for latest) LARAVEL_VERSION= -# weather to run "npm dev run" at boot -AUTO_START_NPM_DEV=true +# weather to run "npm dev" at boot +BOOT_NPM_DEV=true + +# runs npm install at boot +BOOT_NPM_INSTALL=true + +# runs composer install at boot +BOOT_COMPOSER_INSTALL=true # external ports FORWARD_LARAVEL_PORT=80 diff --git a/build/start-container.sh b/build/start-container.sh index 5b2a357..5ccf337 100644 --- a/build/start-container.sh +++ b/build/start-container.sh @@ -6,19 +6,22 @@ set -e # init nvm \. $NVM_DIR/nvm.sh - -if [[ "$INSTALL_BEFORE_START" = true ]]; then - echo "composer and npm install" - composer install +if [[ "$BOOT_NPM_INSTALL" = true ]]; then + echo "npm install" npm install fi +if [[ "$BOOT_COMPOSER_INSTALL" = true ]]; then + echo "composer install" + composer install +fi + if [ ! -f /var/www/html/artisan ]; then echo "No existing Laravel project found" exit fi -if [[ "$AUTO_START_NPM_DEV" = true ]]; then +if [[ "$BOOT_NPM_DEV" = true ]]; then echo "Staring npm dev" npm run dev --prefix /var/www/html & fi