File tree Expand file tree Collapse file tree 3 files changed +20
-2
lines changed
Expand file tree Collapse file tree 3 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,8 @@ COPY . .
2424
2525RUN corepack enable pnpm && pnpm run build
2626
27+ COPY .next/cache/fetch-cache/ .next/standalone/.next/cache/fetch-cache/
28+
2729FROM base AS runner
2830WORKDIR /app
2931
Original file line number Diff line number Diff line change @@ -22,8 +22,14 @@ module.exports = withSentryConfig({
2222 localeDetection : false ,
2323 } ,
2424 trailingSlash : false ,
25- cacheHandler : require . resolve ( "./cache-handler.js" ) ,
26- cacheMaxMemorySize : 0 , // disable default in-memory caching
25+ cacheHandler :
26+ process . env . NODE_ENV === "production"
27+ ? require . resolve ( "./cache-handler.mjs" )
28+ : undefined ,
29+ cacheMaxMemorySize : 0 ,
30+ experimental : {
31+ instrumentationHook : true ,
32+ } ,
2733 async headers ( ) {
2834 return [
2935 {
Original file line number Diff line number Diff line change 1+ export async function register ( ) {
2+ if ( process . env . NEXT_RUNTIME === "nodejs" ) {
3+ const { registerInitialCache } = await import (
4+ "@neshca/cache-handler/instrumentation"
5+ ) ;
6+
7+ const CacheHandler = ( await import ( "../cache-handler.mjs" ) ) . default ;
8+ await registerInitialCache ( CacheHandler ) ;
9+ }
10+ }
You can’t perform that action at this time.
0 commit comments