Files
AFC-Demo/deploy/docker-entrypoint.sh
T

27 lines
898 B
Bash
Raw Normal View History

2025-10-23 12:22:27 +02:00
#!/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; }
2025-10-23 12:39:40 +02:00
php artisan config:clear
php artisan cache:clear
2025-10-23 13:05:17 +02:00
envsubst '$SERVER_NAME' < /etc/nginx/templates/default.conf.template > /etc/nginx/http.d/default.conf
2025-10-23 12:39:40 +02:00
2025-10-23 12:22:27 +02:00
exec /usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf