feat: entrypoint

This commit is contained in:
Ivan Rezchikov
2026-07-12 16:52:50 +03:00
parent 039cb4d2d3
commit 549dc6b9da
2 changed files with 23 additions and 1 deletions
+19
View File
@@ -0,0 +1,19 @@
#!/bin/sh
set -e
NGINX_PROXY_NAME="${NGINX_PROXY_CONTAINER_NAME:-nginx-proxy}"
TARGET_DOMAIN=$(echo "$MINIO_PUBLIC_URL" | sed -E 's#^https?://##; s#/.*##; s#:.*##')
if [ -n "$TARGET_DOMAIN" ]; then
IP=$(getent hosts "$NGINX_PROXY_NAME" | awk '{ print $1 }' | head -n1)
if [ -n "$IP" ]; then
echo "$IP $TARGET_DOMAIN" >> /etc/hosts
echo "[entrypoint] resolved $NGINX_PROXY_NAME -> $IP for $TARGET_DOMAIN"
else
echo "[entrypoint] WARNING: could not resolve $NGINX_PROXY_NAME, using public DNS as fallback"
fi
fi
exec "$@"