Add Docker-based dev/prod setup with zail helper scripts
This commit is contained in:
23
docker/php-fpm/entrypoint.sh
Normal file
23
docker/php-fpm/entrypoint.sh
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/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 "$@"
|
||||
Reference in New Issue
Block a user