diff --git a/Dockerfile b/Dockerfile index 3728e97..0c91bda 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,6 +19,21 @@ WORKDIR /app RUN npm ci --omit=dev FROM public.ecr.aws/docker/library/node:20-alpine AS build-env + +# These have to be declared HERE, not only in development-dependencies-env: +# build args do not cross stages, and this is the stage that runs `npm run +# build`. Without them Vite inlines the fallbacks from app/routes/*.tsx -- +# https://api.t4t-gateway.com -- so an image built for anywhere else silently +# drives production. +ARG VITE_API_URL +ENV VITE_API_URL=$VITE_API_URL + +ARG VITE_GOOGLE_CLIENT_ID +ENV VITE_GOOGLE_CLIENT_ID=$VITE_GOOGLE_CLIENT_ID + +ARG VITE_COMMIT_SHA +ENV VITE_COMMIT_SHA=$VITE_COMMIT_SHA + COPY . /app/ COPY --from=development-dependencies-env /app/node_modules /app/node_modules WORKDIR /app