fix: set API_BASE_URL at Docker build time for Next.js inlining
Next.js replaces process.env.X with build-time values via DefinePlugin, even in server-side route handlers. Without the env var set during build, it always falls back to localhost:8000 which doesn't work inside Docker. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
e5dcfa6113
commit
28131491e2
|
|
@ -8,6 +8,11 @@ RUN npm ci
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
# Set API_BASE_URL at build time so Next.js inlines the correct value
|
||||||
|
# (Next.js replaces process.env.X at build time via DefinePlugin)
|
||||||
|
ARG API_BASE_URL=http://api-gateway:8000
|
||||||
|
ENV API_BASE_URL=${API_BASE_URL}
|
||||||
|
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# ===== Production =====
|
# ===== Production =====
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue