From 68c176f9726a04afb753a1fed4e8f29145c8ac2d Mon Sep 17 00:00:00 2001 From: ypratama Date: Wed, 2 Sep 2026 11:21:26 +0700 Subject: [PATCH] Fix: Change localhost to 127.0.0.1 in backend healthchecks to bypass Node IPv6 resolution issue with 0.0.0.0 bind --- backend/Dockerfile | 2 +- backend/Dockerfile.bun | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 6c2fa0a..7fa483e 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -15,6 +15,6 @@ EXPOSE 3001 # Health check HEALTHCHECK --interval=30s --timeout=10s --start-period=20s --retries=3 \ - CMD node -e "require('http').get('http://localhost:3001/api/health', r => r.statusCode === 200 ? process.exit(0) : process.exit(1)).on('error', () => process.exit(1))" + CMD node -e "require('http').get('http://127.0.0.1:3001/api/health', r => r.statusCode === 200 ? process.exit(0) : process.exit(1)).on('error', () => process.exit(1))" CMD ["node", "server.js"] diff --git a/backend/Dockerfile.bun b/backend/Dockerfile.bun index 2a5595a..e6b32e4 100644 --- a/backend/Dockerfile.bun +++ b/backend/Dockerfile.bun @@ -10,6 +10,6 @@ COPY backend/ . EXPOSE 3001 HEALTHCHECK --interval=30s --timeout=10s --start-period=20s --retries=3 \ - CMD bun -e "require('http').get('http://localhost:3001/api/health', r => r.statusCode === 200 ? process.exit(0) : process.exit(1)).on('error', () => process.exit(1))" + CMD bun -e "require('http').get('http://127.0.0.1:3001/api/health', r => r.statusCode === 200 ? process.exit(0) : process.exit(1)).on('error', () => process.exit(1))" CMD ["bun", "run", "server.js"]