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:
parent
20b6fc86ce
commit
e78c33ae18
|
|
@ -11,11 +11,11 @@
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
FROM node:22-slim AS builder
|
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
|
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 \
|
RUN --mount=type=cache,target=/root/.local/share/pnpm/store \
|
||||||
pnpm install --frozen-lockfile
|
pnpm install --frozen-lockfile
|
||||||
|
|
@ -24,9 +24,11 @@ COPY frontend/ .
|
||||||
|
|
||||||
ARG VITE_API_URL=/api
|
ARG VITE_API_URL=/api
|
||||||
ARG VITE_APP_TITLE="My App"
|
ARG VITE_APP_TITLE="My App"
|
||||||
|
ARG VITE_TURNSTILE_SITE_KEY=""
|
||||||
|
|
||||||
ENV VITE_API_URL=${VITE_API_URL} \
|
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
|
RUN pnpm build
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue