Files
laravel-starter-kit/docker/php-fpm/entrypoint.sh

24 lines
573 B
Bash

#!/usr/bin/env sh
set -e
APP_DIR=/var/www
if [ -n "${UID}" ] && [ -n "${GID}" ]; then
echo "Fixing file permissions with UID=${UID} and GID=${GID}..."
for path in storage bootstrap/cache; do
if [ -d "${APP_DIR}/${path}" ]; then
chown -R "${UID}:${GID}" "${APP_DIR}/${path}" || true
fi
done
fi
if [ -f "${APP_DIR}/artisan" ]; then
echo "Clearing configurations..."
php "${APP_DIR}/artisan" config:clear || true
php "${APP_DIR}/artisan" route:clear || true
php "${APP_DIR}/artisan" view:clear || true
fi
exec "$@"