diff --git a/Dockerfile b/Dockerfile index f019892a8..936442cc6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -52,7 +52,7 @@ COPY --from=builder /app/packages/db/migrations ./db/migrations # Automatically leverage output traces to reduce image size # https://nextjs.org/docs/advanced-features/output-file-tracing COPY --from=builder /app/apps/nextjs/.next/standalone ./ -COPY apps/nextjs/socket-cleanup.cjs ./apps/nextjs/socket-cleanup.cjs +COPY --from=builder /app/apps/nextjs/socket-cleanup.cjs ./apps/nextjs/socket-cleanup.cjs COPY --from=builder /app/apps/nextjs/.next/static ./apps/nextjs/.next/static COPY --from=builder /app/apps/nextjs/public ./apps/nextjs/public COPY scripts/run.sh ./run.sh diff --git a/apps/nextjs/socket-cleanup.cjs b/apps/nextjs/socket-cleanup.cjs index 7d1310ce9..3847cf0c4 100644 --- a/apps/nextjs/socket-cleanup.cjs +++ b/apps/nextjs/socket-cleanup.cjs @@ -3,7 +3,6 @@ // after client disconnect, leaving sockets in CLOSE-WAIT indefinitely. // // Usage: node --require ./socket-cleanup.cjs server.js -// or: NODE_OPTIONS="--require /app/socket-cleanup.cjs" node server.js const INTERVAL_MS = 60_000; // Check every 60 seconds diff --git a/scripts/run.sh b/scripts/run.sh index 6aae28fcf..3b706f619 100644 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -51,7 +51,7 @@ TASKS_PID=$! node apps/websocket/wssServer.cjs & WSS_PID=$! -node --require apps/nextjs/socket-cleanup.cjs apps/nextjs/server.js & +node --max-old-space-size=1024 --require apps/nextjs/socket-cleanup.cjs apps/nextjs/server.js & NEXTJS_PID=$! # Function to handle SIGTERM and shut down services