Skip to content

Commit 95a2d57

Browse files
author
Fernando Ledesma
committed
add build argument for built-time env vars
1 parent 3c6a86c commit 95a2d57

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

mdk-nextjs-demo/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ COPY . .
2222
FROM dependencies AS builder
2323
WORKDIR /app
2424

25+
# Accept build argument for Next.js build-time env vars
26+
ARG NEXT_PUBLIC_MDK_PREVIEW
27+
ENV NEXT_PUBLIC_MDK_PREVIEW=${NEXT_PUBLIC_MDK_PREVIEW}
28+
2529
# Build the Next.js app with all env vars available
2630
RUN npm run build
2731

0 commit comments

Comments
 (0)