Pratyush-01 commited on
Commit
dd80b32
·
verified ·
1 Parent(s): d6cb922

Dockerfile: bump SPA cache-bust to 10 — force fresh build (drops Compare LLMs tab + stale endpoint copy)

Browse files
Files changed (1) hide show
  1. Dockerfile +19 -9
Dockerfile CHANGED
@@ -26,20 +26,30 @@
26
  ############################
27
  # Stage 1: build the SPA
28
  ############################
 
 
 
 
 
 
29
  FROM node:20-alpine AS frontend
30
- WORKDIR /build
31
  RUN corepack enable
32
 
33
- COPY frontend/package.json frontend/pnpm-lock.yaml ./
34
- RUN pnpm install --frozen-lockfile --silent
35
-
 
 
36
  COPY frontend/ ./
 
37
  # Same-origin API fetches (relative paths). The Space serves both API and UI.
38
  ENV VITE_PHYSIX_API_URL=""
39
- # Cache-bust marker. Bump when an SPA change isn't taking on the Space —
40
- # HF BuildKit occasionally reuses stage-1 output even when sources changed.
41
- # physix-spa-rebuild: 6
42
- RUN pnpm exec tsc -b \
 
43
  && pnpm exec vite build --base=/web/
44
 
45
  ############################
@@ -84,7 +94,7 @@ COPY README.md ./
84
  RUN pip install --no-deps -e .
85
 
86
  # Built SPA from stage 1.
87
- COPY --from=frontend /build/dist /app/static
88
 
89
  # Space wrapper — mounts the React SPA at /web/, registers / -> /web/
90
  # redirect (OpenEnv's create_fastapi_app doesn't add one for us).
 
26
  ############################
27
  # Stage 1: build the SPA
28
  ############################
29
+ # WORKDIR renamed (was /build) to break HF BuildKit's poisoned cache.
30
+ # The previous /build mount kept a stale pnpm symlink at
31
+ # /build/node_modules/@types/katex
32
+ # from an earlier failed deploy, and every subsequent `COPY frontend/ ./`
33
+ # blew up with `cannot copy to non-directory`. Switching paths gets us
34
+ # a fresh cache bucket; nothing in the project depends on /build itself.
35
  FROM node:20-alpine AS frontend
36
+ WORKDIR /spa
37
  RUN corepack enable
38
 
39
+ # Copy ALL of frontend/ first — including package.json/pnpm-lock.yaml
40
+ # THEN install. Order matters: install runs ON TOP OF the source tree
41
+ # instead of the source tree being overlaid on top of a pre-installed
42
+ # node_modules, eliminating the directory-vs-symlink collision class
43
+ # of failure entirely.
44
  COPY frontend/ ./
45
+
46
  # Same-origin API fetches (relative paths). The Space serves both API and UI.
47
  ENV VITE_PHYSIX_API_URL=""
48
+
49
+ # Cache-bust marker. Bump when an SPA change isn't taking on the Space.
50
+ # physix-spa-rebuild: 10
51
+ RUN pnpm install --frozen-lockfile \
52
+ && pnpm exec tsc -b \
53
  && pnpm exec vite build --base=/web/
54
 
55
  ############################
 
94
  RUN pip install --no-deps -e .
95
 
96
  # Built SPA from stage 1.
97
+ COPY --from=frontend /spa/dist /app/static
98
 
99
  # Space wrapper — mounts the React SPA at /web/, registers / -> /web/
100
  # redirect (OpenEnv's create_fastapi_app doesn't add one for us).