Add Next.js instrumentation hook and update HTTP agent options to disable keep-alive for Google OAuth
Build and Push Reader Image / docker (push) Successful in 2m21s

This commit is contained in:
2026-04-24 01:30:05 +07:00
parent d9a6629d31
commit 690a2fbd51
2 changed files with 35 additions and 0 deletions
+7
View File
@@ -3,6 +3,13 @@ const readerApiOrigin = (process.env.READER_API_ORIGIN || "http://localhost:8000
const nextConfig = {
output: "standalone",
// Tắt HTTP keep-alive để tránh stale connection tới Google OAuth.
// Sau lần đăng nhập đầu, Node.js giữ TCP socket tới oauth2.googleapis.com trong pool.
// NAT/firewall của Docker drop socket sau vài phút (silently). Khi login lần 2,
// openid-client (bên trong NextAuth) reuse socket đã chết → request treo → OAUTH_CALLBACK_ERROR 3500ms.
httpAgentOptions: {
keepAlive: false,
},
typescript: {
ignoreBuildErrors: true,
},