From b9ad280192d438304fd240596cf5eceff5090793 Mon Sep 17 00:00:00 2001 From: Ho Ngoc Hai Date: Tue, 14 Apr 2026 19:54:56 +0700 Subject: [PATCH] =?UTF-8?q?fix:=20Web=20Dockerfile=20=E2=80=94=20set=20NEX?= =?UTF-8?q?T=5FPUBLIC=5FAPI=5FURL=20at=20build=20time?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NEXT_PUBLIC_* env vars are inlined into the JS bundle during next build. Without setting them as build ARGs, the client-side apiClient falls back to localhost:3001 which doesn't work in production. Co-Authored-By: Claude Opus 4.6 (1M context) --- apps/web/Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/web/Dockerfile b/apps/web/Dockerfile index 0e01658..b65c884 100644 --- a/apps/web/Dockerfile +++ b/apps/web/Dockerfile @@ -14,6 +14,11 @@ RUN pnpm install --frozen-lockfile --filter @goodgo/web... # ---- Build ---- FROM base AS build +# NEXT_PUBLIC_* vars are baked into JS bundle at build time +ARG NEXT_PUBLIC_API_URL=https://api.goodgo.vn +ARG NEXT_PUBLIC_WEB_URL=https://platform.goodgo.vn +ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL +ENV NEXT_PUBLIC_WEB_URL=$NEXT_PUBLIC_WEB_URL COPY --from=deps /app/.npmrc ./ COPY --from=deps /app/node_modules ./node_modules COPY tsconfig.base.json ./