From c2dd1dbf84e0624fc98812e759e7b974594308e8 Mon Sep 17 00:00:00 2001 From: Chris Farhood Date: Thu, 14 May 2026 19:51:34 +0000 Subject: [PATCH] fix: add explicit ARG/ENV VITE_API_URL to Dockerfile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without this, Vite sees VITE_API_URL as undefined (not empty string) at build time. The ?? operator only replaces null/undefined, not a missing var, so better-auth receives undefined — which it treats as a relative path and prepends window.location.origin at build time, resulting in the UAT URL being baked in. Explicitly setting ARG VITE_API_URL= (empty string) in the Dockerfile makes Vite see it as defined with empty value, so the || fallback fires at runtime. Fixes GRO-1280. --- apps/web/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/web/Dockerfile b/apps/web/Dockerfile index eb110fa..f551990 100644 --- a/apps/web/Dockerfile +++ b/apps/web/Dockerfile @@ -11,6 +11,8 @@ RUN pnpm install --frozen-lockfile # Build FROM deps AS builder +ARG VITE_API_URL= +ENV VITE_API_URL= COPY packages/types/ packages/types/ COPY apps/web/ apps/web/ RUN pnpm --filter @groombook/web build