diff --git a/Dockerfile b/Dockerfile index a7dd132..92a8305 100644 --- a/Dockerfile +++ b/Dockerfile @@ -272,10 +272,13 @@ window.__RUNTIME_CONFIG__ = { }; JSEOF -# Inject analytics script if provided +# Inject analytics script if provided (only if not already injected) if [ -n "\${ANALYTICS_SCRIPT:-}" ]; then - echo "Injecting analytics script..." - sed -i "s## \${ANALYTICS_SCRIPT}"$'\n'" #" /app/ui/build/index.html + if ! grep -q "rybbit.databasus.com" /app/ui/build/index.html 2>/dev/null; then + echo "Injecting analytics script..." + sed -i "s## \${ANALYTICS_SCRIPT}\\ + #" /app/ui/build/index.html + fi fi # Ensure proper ownership of data directory