Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

feat: add support for DATABASE_ARGS config (#5143)

Steffen Schmitzb34da5a0defd
diff --git a/web/entrypoint.sh b/web/entrypoint.sh
index 8143bc00f2..00bcd37fe9 100644
--- a/web/entrypoint.sh
+++ b/web/entrypoint.sh
@@ -12,6 +12,11 @@ if [ -z "$DATABASE_URL" ]; then
echo "Error: Required database environment variables are not set. Provide a postgres url for DATABASE_URL."
exit 1
fi
+ if [ -n "$DATABASE_ARGS" ]; then
+ # Append ARGS to DATABASE_URL
+ DATABASE_URL="${DATABASE_URL}?$DATABASE_ARGS"
+ export DATABASE_URL
+ fi
fi
# Check if CLICKHOUSE_URL is not set
@@ -22,7 +27,7 @@ fi
# Set DIRECT_URL to the value of DATABASE_URL if it is not set, required for migrations
if [ -z "$DIRECT_URL" ]; then
- export DIRECT_URL=$DATABASE_URL
+ export DIRECT_URL="${DATABASE_URL}"
fi
# Always execute the postgres migration, except when disabled.
diff --git a/worker/entrypoint.sh b/worker/entrypoint.sh
index c4e2de5810..a372cfab32 100644
--- a/worker/entrypoint.sh
+++ b/worker/entrypoint.sh
@@ -12,6 +12,11 @@ if [ -z "$DATABASE_URL" ]; then
echo "Error: Required database environment variables are not set. Provide a postgres url for DATABASE_URL."
exit 1
fi
+ if [ -n "$DATABASE_ARGS" ]; then
+ # Append ARGS to DATABASE_URL
+ DATABASE_URL="${DATABASE_URL}?$DATABASE_ARGS"
+ export DATABASE_URL
+ fi
fi
# Run the command passed to the docker image on start