Expose public build-time environment variables
Declare and pass PocketBase, TomTom, and QuickBooks webhook public variables into the Docker build environment so Next.js can bake Ship-provided values into the browser bundle.
This commit is contained in:
parent
139ea259f4
commit
3ca66ef19a
1 changed files with 9 additions and 0 deletions
|
|
@ -10,6 +10,15 @@ FROM node:20-alpine AS builder
|
|||
WORKDIR /app
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
# Public variables are baked into the browser code by `next build`, so they must
|
||||
# exist at build time. Ship passes them from .env.local; a name that is not
|
||||
# declared here is silently ignored by the build.
|
||||
ARG NEXT_PUBLIC_POCKETBASE_URL
|
||||
ARG NEXT_PUBLIC_TOMTOM_API_KEY
|
||||
ARG NEXT_PUBLIC_QB_INVOICE_WEBHOOK_URL
|
||||
ENV NEXT_PUBLIC_POCKETBASE_URL=${NEXT_PUBLIC_POCKETBASE_URL}
|
||||
ENV NEXT_PUBLIC_TOMTOM_API_KEY=${NEXT_PUBLIC_TOMTOM_API_KEY}
|
||||
ENV NEXT_PUBLIC_QB_INVOICE_WEBHOOK_URL=${NEXT_PUBLIC_QB_INVOICE_WEBHOOK_URL}
|
||||
# The commit being built, supplied by Ship. Declared late so the layers above
|
||||
# stay cached; it is empty for builds that do not pass it.
|
||||
ARG NEXT_PUBLIC_APP_COMMIT
|
||||
|
|
|
|||
Loading…
Reference in a new issue