File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,14 @@ COPY package*.json ./
77
88FROM base AS build
99ENV NODE_ENV=production
10+ ENV STRAPI_CACHE_ENABLED=true
1011COPY ./.kube/config.yaml ./.kube/config.yaml
1112RUN --mount=type=cache,target=/root/.npm npm install --ignore-scripts
1213COPY . .
1314RUN chmod -R 755 src/pages
15+ # Warmup: .cache in layer, so production gets it at runtime
16+ RUN npm run build:cache
17+ # Build: cache mount speeds up rebuilds; .cache from layer above persists after unmount
1418RUN --mount=type=cache,target=/app/.cache npm run build
1519
1620FROM base AS development
@@ -29,6 +33,7 @@ COPY --from=build /app/server.mjs ./server.mjs
2933COPY --from=build /app/package*.json ./
3034RUN --mount=type=cache,target=/root/.npm npm install --omit=dev --ignore-scripts
3135COPY --from=build /app/src/pages ./src/pages
36+ COPY --from=build /app/.cache ./.cache
3237RUN chmod -R 755 src/pages
3338
3439ENV HOST=0.0.0.0
Original file line number Diff line number Diff line change 1010 "dev:astro" : " astro dev --host --typecheck" ,
1111 "build:astro" : " astro check --skip-playwright && astro build" ,
1212 "dev" : " npm run build:pagefind && npm run copy:pagefind && npm run dev:astro" ,
13- "build" : " npm run build:cache && npm run build: astro && npm run build:pagefind" ,
13+ "build" : " npm run build:astro && npm run build:pagefind" ,
1414 "build:cache" : " tsx scripts/warmup-cache.ts" ,
1515 "start" : " node ./server.mjs" ,
1616 "start:original" : " node ./dist/server/entry.mjs" ,
You can’t perform that action at this time.
0 commit comments