clusev/docker/entrypoint.sh

22 lines
602 B
Bash

#!/bin/sh
set -e
cd /var/www/html
# Ensure Laravel's writable dirs exist (dev bind-mount may not have them yet).
mkdir -p \
storage/framework/cache \
storage/framework/sessions \
storage/framework/views \
storage/logs \
bootstrap/cache
# When running as root (the `app` service / prod), hand storage to the app user
# so php-fpm (which runs as `app`) can write. Non-root services (vite/queue/
# reverb run as the host UID) skip this — they already own the bind-mount.
if [ "$(id -u)" = "0" ]; then
chown -R app:app storage bootstrap/cache 2>/dev/null || true
fi
exec "$@"