Remove studio index.html from static files to force SSR path rewriting

Astro's static middleware was serving public/studio/index.html directly,
bypassing the [...path].ts route that rewrites /static/ to /studio/static/.
Deleting it makes all /studio requests go through the SSR rewrite.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Calum Muir 2026-06-07 12:58:01 +00:00
parent 8e2cd0b0d6
commit 7911a32676

View file

@ -26,6 +26,9 @@ FROM base AS build
COPY --from=deps /app/node_modules ./node_modules COPY --from=deps /app/node_modules ./node_modules
COPY . . COPY . .
COPY --from=studio-build /app/dist ./public/studio COPY --from=studio-build /app/dist ./public/studio
# Remove index.html so /studio requests fall through to the SSR route,
# which rewrites /static/ asset paths to /studio/static/ before serving.
RUN rm -f ./public/studio/index.html
ARG SANITY_PROJECT_ID ARG SANITY_PROJECT_ID
ARG SANITY_DATASET=production ARG SANITY_DATASET=production
ARG SANITY_API_TOKEN ARG SANITY_API_TOKEN