Skip to content
Snippets Groups Projects
Unverified Commit 397ea51a authored by Janyk Steenbeek's avatar Janyk Steenbeek Committed by GitHub
Browse files

Update startup.sh

parent 6f0c3cf6
No related branches found
No related tags found
No related merge requests found
#!/bin/sh #!/bin/sh
ARTISAN_FILE="/app/artisan"
# Check if artisan exists and is executable
if [[ -x "$(command -v php)" && -x "${ARTISAN_FILE}" ]]; then
# Check if SKIP_OPTIMIZE_COMMANDS is NOT set
if [[ -z "${SKIP_OPTIMIZE_COMMANDS}" ]]; then
echo "Running artisan commands for production environment..."
# Run recommended artisan commands for production
php ${ARTISAN_FILE} config:cache
php ${ARTISAN_FILE} route:cache
php ${ARTISAN_FILE} view:cache
php ${ARTISAN_FILE} optimize
else
echo "Skipping optimization commands due to the SKIP_OPTIMIZE_COMMANDS environment variable."
fi
else
echo "Artisan or PHP not found. Skipping optimization commands."
fi
echo "Starting PHP FPM in daemon mode" echo "Starting PHP FPM in daemon mode"
php-fpm -D php-fpm -D
# while ! nc -w 1 -z 127.0.0.1 9000; do sleep 0.1; done;
echo "Testing NGINX" echo "Testing NGINX"
nginx -t nginx -t
cat /etc/nginx/nginx.conf cat /etc/nginx/nginx.conf
echo "Starting NGINX" echo "Starting NGINX"
nginx nginx
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment