Files
hoshpoint-backend/docker/entrypoint.sh

34 lines
789 B
Bash

#!/usr/bin/env sh
set -eu
mkdir -p \
storage/app/public \
storage/framework/cache/data \
storage/framework/sessions \
storage/framework/views \
storage/logs \
bootstrap/cache
if [ ! -L public/storage ]; then
rm -rf public/storage
ln -s ../storage/app/public public/storage
fi
if [ "$(id -u)" = "0" ]; then
chown -R www-data:www-data storage bootstrap/cache
fi
if [ -z "${APP_KEY:-}" ]; then
echo "ERROR: APP_KEY is empty. Set it in .env.production, then restart containers." >&2
echo " php artisan key:generate --show" >&2
exit 1
fi
if [ "${APP_ENV:-production}" = "production" ]; then
php artisan config:cache --no-interaction
php artisan event:cache --no-interaction
php artisan view:cache --no-interaction
fi
exec "$@"