2024-12-13 09:00:45 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
WEBROOT=/www
|
|
|
|
PHP=${PHP:-none}
|
|
|
|
USERNAME=${USERNAME:-theuser}
|
2024-12-13 09:45:43 +00:00
|
|
|
RANDOMPWD=$(tr -dc A-Za-z0-9 </dev/urandom | head -c 13)
|
|
|
|
printf '%s\n%s' "${RANDOMPWD}" "${RANDOMPWD}" | adduser -DH -h "${WEBROOT}" -G "nginx" -u "1000" "${USERNAME}"
|
2024-12-13 09:00:45 +00:00
|
|
|
|
|
|
|
chown "${USERNAME}:nginx" "${WEBROOT}" -R
|
|
|
|
find "${WEBROOT}" -type d -exec chmod 0755 {} \;
|
|
|
|
find "${WEBROOT}" -type f -exec chmod 0644 {} \;
|
|
|
|
|
|
|
|
envsubst < /app/nginx.conf.tpl > /etc/nginx/http.d/default.conf
|
|
|
|
|
|
|
|
case "${PHP}" in
|
|
|
|
"php84") /usr/sbin/php-fpm84 -D ;;
|
|
|
|
"php83") /usr/sbin/php-fpm83 -D ;;
|
|
|
|
"php82") /usr/sbin/php-fpm82 -D ;;
|
|
|
|
*) ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
nginx
|