fix: php config
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
SERVER_NAME="${SERVER_NAME:-$(hostname -f 2>/dev/null || hostname)}"
|
||||
export SERVER_NAME
|
||||
|
||||
# Ensure dirs
|
||||
mkdir -p /etc/nginx/http.d /etc/nginx/conf.d /run/nginx /run/php
|
||||
|
||||
# Render vhost ONLY into http.d so it's inside http{} context
|
||||
if [ -f /etc/nginx/templates/default.conf.template ]; then
|
||||
envsubst '$SERVER_NAME' < /etc/nginx/templates/default.conf.template > /etc/nginx/http.d/default.conf
|
||||
else
|
||||
echo "[entrypoint] ERROR: missing /etc/nginx/templates/default.conf.template" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "[entrypoint] Using SERVER_NAME=$SERVER_NAME"
|
||||
nginx -t || { echo "[entrypoint] nginx config test failed" >&2; cat /var/log/nginx/error.log || true; exit 1; }
|
||||
|
||||
php artisan config:clear
|
||||
php artisan cache:clear
|
||||
|
||||
envsubst '$SERVER_NAME' < /etc/nginx/templates/default.conf.template > /etc/nginx/http.d/default.conf
|
||||
|
||||
exec /usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf
|
||||
|
||||
Reference in New Issue
Block a user