Skip to content

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

fix: do not execute db migration in web container if configured in env (#2446)

Max Deichmann0bbf87abfd09
diff --git a/web/Dockerfile b/web/Dockerfile
index 18b3b6d878..4aa75995fa 100644
--- a/web/Dockerfile
+++ b/web/Dockerfile
@@ -41,6 +41,7 @@ ARG NEXT_PUBLIC_TURNSTILE_SITE_KEY
ARG NEXT_PUBLIC_POSTHOG_KEY
ARG NEXT_PUBLIC_POSTHOG_HOST
ARG NEXT_PUBLIC_CRISP_WEBSITE_ID
+ARG LANFUSE_WEB_MIGRATION_ENABLED
# Copy source code of isolated subworkspace
COPY --from=pruner /app/out/full/ .
diff --git a/web/entrypoint.sh b/web/entrypoint.sh
index ae58f4c305..8d64be98fd 100644
--- a/web/entrypoint.sh
+++ b/web/entrypoint.sh
@@ -19,10 +19,13 @@ if [ -z "$DIRECT_URL" ]; then
export DIRECT_URL=$DATABASE_URL
fi
-prisma db execute --url "$DIRECT_URL" --file "./packages/shared/scripts/cleanup.sql"
+# Always execute the scripts, except when disabled.
+if [ "$LANFUSE_WEB_MIGRATION_DISABLED" != "true" ]; then
+ prisma db execute --url "$DIRECT_URL" --file "./packages/shared/scripts/cleanup.sql"
-# Apply migrations
-prisma migrate deploy --schema=./packages/shared/prisma/schema.prisma
+ # Apply migrations
+ prisma migrate deploy --schema=./packages/shared/prisma/schema.prisma
+fi
status=$?
# If migration fails (returns non-zero exit status), exit script with that status
diff --git a/web/src/sentry.server.config.ts b/web/src/sentry.server.config.ts
index 6f656cd397..69a653d44d 100644
--- a/web/src/sentry.server.config.ts
+++ b/web/src/sentry.server.config.ts
@@ -25,7 +25,7 @@ if (process.env.NEXT_PUBLIC_SENTRY_DSN)
) {
return 0.1;
}
- return 0.01;
+ return 0.1;
},
profilesSampleRate: 0.1,