initial commit
This commit is contained in:
19
docker/php-fpm/entrypoint.sh
Normal file
19
docker/php-fpm/entrypoint.sh
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
set -euo pipefail
|
||||
|
||||
# Entrypoint for php-fpm images.
|
||||
# If CHOWN_ON_START is set to '1' or 'true', recursively chown the webroot
|
||||
# to the 'app' user (UID 1000). This is optional and must be explicitly enabled
|
||||
# via environment (safer for multi-tenant hosts).
|
||||
|
||||
: ${CHOWN_ON_START:=}
|
||||
if [ "${CHOWN_ON_START}" = "1" ] || [ "${CHOWN_ON_START}" = "true" ]; then
|
||||
echo "[entrypoint] CHOWN_ON_START enabled — fixing ownership of /var/www/html"
|
||||
# Only run chown if the directory exists
|
||||
if [ -d /var/www/html ]; then
|
||||
chown -R 1000:1000 /var/www/html || true
|
||||
fi
|
||||
fi
|
||||
|
||||
# Exec the given command (php-fpm by default)
|
||||
exec "$@"
|
||||
Reference in New Issue
Block a user