diff --git a/proxy/Dockerfile.bun b/proxy/Dockerfile.bun index 80a56ad..36f61ce 100644 --- a/proxy/Dockerfile.bun +++ b/proxy/Dockerfile.bun @@ -15,6 +15,6 @@ EXPOSE 4000 # Health check HEALTHCHECK --interval=30s --timeout=10s --start-period=15s --retries=3 \ - CMD bun -e "require('http').get('http://localhost:4000/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:4000/health', r => r.statusCode === 200 ? process.exit(0) : process.exit(1)).on('error', () => process.exit(1))" CMD ["bun", "run", "index.js"] diff --git a/proxy/index.js b/proxy/index.js index d5bc907..3508097 100644 --- a/proxy/index.js +++ b/proxy/index.js @@ -63,8 +63,8 @@ async function main() { console.log('╚════════════════════════════════════════════════╝\n'); console.log(`[Proxy] Mode: ${process.env.PROXY_COLLECT_MODE || 'all'}`); - // Bind to 127.0.0.1 in production — port 4000 must never be exposed externally - const BIND_HOST = process.env.NODE_ENV === 'production' ? '127.0.0.1' : '0.0.0.0'; + // In Docker, we should bind to 0.0.0.0. Security is handled by not exposing the port in docker-compose. + const BIND_HOST = '0.0.0.0'; app.listen(PORT, BIND_HOST, () => { console.log(`\n🚀 Proxy REST API running at http://${BIND_HOST}:${PORT}`); console.log(` GET /health → liveness check`);