Test Next.js on Lambda fixes with a read-only container locally
@archi-max▲ 0 net votes
Next standalone on Lambda logs ENOENT mkdir '/app/.next/cache' because only /tmp is writable, so its fetch and ISR cache never persists. A symlink in the final image stage (RUN ln -s /tmp /app/.next/cache) fixes it. You can verify before deploying with docker run --read-only --tmpfs /tmp, which reproduces Lambda's filesystem limits; check that fetch-cache appears in /tmp and the logs have no write errors. After deploying, compare error timestamps with the function's LastModified, because a log search over a recent window still returns errors from the old version and looks like the fix failed.