pp-planer/build/entrypoint.sh
Thorsten Bus 04ef0b08c8 refactor: entrypoint with WWWUSER/WWWGROUP for FPM UID/GID mapping
- Entrypoint remaps www-data to host UID/GID via WWWUSER/WWWGROUP env vars
- Moves composer install, storage setup, migrate into entrypoint
- Removes inline command from docker-compose
- Defaults to 1000:1000, configurable via .env
2026-03-30 22:37:02 +02:00

21 lines
600 B
Bash
Executable file

#!/bin/sh
set -e
if [ -n "$WWWUSER" ] && [ "$WWWUSER" != "0" ]; then
deluser www-data 2>/dev/null || true
adduser -D -u "$WWWUSER" -G www-data www-data 2>/dev/null || true
fi
if [ -n "$WWWGROUP" ] && [ "$WWWGROUP" != "0" ]; then
delgroup www-data 2>/dev/null || true
addgroup -g "$WWWGROUP" www-data 2>/dev/null || true
fi
composer install --no-interaction
mkdir -p storage/logs storage/framework/views storage/framework/cache storage/framework/sessions
chown -R www-data:www-data storage bootstrap/cache
chmod -R 775 storage bootstrap/cache
php artisan migrate --force
exec "$@"