fix: pass NEXT_PUBLIC_API_URL as Docker build ARG so Next.js bakes it into bundle
This commit is contained in:
parent
e097b5f17b
commit
ef3f2ace25
1 changed files with 5 additions and 1 deletions
|
|
@ -15,6 +15,10 @@ RUN test -f .env.local || echo "# placeholder" > .env.local
|
|||
# Install dependencies
|
||||
RUN pnpm install --frozen-lockfile --ignore-scripts
|
||||
|
||||
# Inject NEXT_PUBLIC_API_URL at build time (Next.js bakes NEXT_PUBLIC_* into the bundle)
|
||||
ARG NEXT_PUBLIC_API_URL
|
||||
ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL
|
||||
|
||||
# Build
|
||||
RUN pnpm build
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue