diff --git a/Dockerfile b/Dockerfile index c615f11..19bcaea 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,10 @@ COPY . . # Prisma client + TypedSQL must be pre-generated locally (needs live DB for --sql). # src/generated/ is gitignored but included in Docker context from local dev. ENV DATABASE_URL="postgresql://placeholder:placeholder@localhost:5432/placeholder" +ARG NEXT_PUBLIC_GOOGLE_MAPS_API_KEY +ARG NEXT_PUBLIC_GOOGLE_MAP_ID +ENV NEXT_PUBLIC_GOOGLE_MAPS_API_KEY=$NEXT_PUBLIC_GOOGLE_MAPS_API_KEY +ENV NEXT_PUBLIC_GOOGLE_MAP_ID=$NEXT_PUBLIC_GOOGLE_MAP_ID RUN npx next build FROM node:22-slim AS runner diff --git a/README.md b/README.md index 64ed1fd..3ce649d 100644 --- a/README.md +++ b/README.md @@ -151,8 +151,11 @@ The app is containerized as a standalone Next.js image for production deployment # Prisma TypedSQL must be generated locally first (requires live database) bunx prisma generate --sql -# Build the production image -docker build -t registry.claiborne.soy/busi488energy:latest . +# Build the production image (NEXT_PUBLIC_* vars are inlined at build time) +docker build \ + --build-arg NEXT_PUBLIC_GOOGLE_MAPS_API_KEY="your-key" \ + --build-arg NEXT_PUBLIC_GOOGLE_MAP_ID="your-map-id" \ + -t registry.claiborne.soy/busi488energy:latest . # Push to the internal registry docker push registry.claiborne.soy/busi488energy:latest