fix(canary): declare VITE_TURNSTILE_SITE_KEY ARG in prod Dockerfile

Audit F4: compose.yml already passed VITE_TURNSTILE_SITE_KEY as a build arg,
but vite.prod never declared an ARG/ENV for it, so Vite's import.meta.env
resolved to undefined. The Turnstile widget never rendered in prod, causing
the backend to reject every create-token request with TURNSTILE_FAILED.
This commit is contained in:
CarterPerez-dev 2026-05-17 19:07:39 -04:00
parent 20b6fc86ce
commit e78c33ae18
1 changed files with 5 additions and 3 deletions

View File

@ -11,11 +11,11 @@
# ============================================================================
FROM node:22-slim AS builder
RUN corepack enable && corepack prepare pnpm@latest --activate
RUN corepack enable && corepack prepare pnpm@10.29.1 --activate
WORKDIR /app
COPY frontend/package.json frontend/pnpm-lock.yaml* ./
COPY frontend/package.json frontend/pnpm-lock.yaml* frontend/.npmrc* ./
RUN --mount=type=cache,target=/root/.local/share/pnpm/store \
pnpm install --frozen-lockfile
@ -24,9 +24,11 @@ COPY frontend/ .
ARG VITE_API_URL=/api
ARG VITE_APP_TITLE="My App"
ARG VITE_TURNSTILE_SITE_KEY=""
ENV VITE_API_URL=${VITE_API_URL} \
VITE_APP_TITLE=${VITE_APP_TITLE}
VITE_APP_TITLE=${VITE_APP_TITLE} \
VITE_TURNSTILE_SITE_KEY=${VITE_TURNSTILE_SITE_KEY}
RUN pnpm build