fix(docker): bind Node to IPv4 loopback for NGINX upstream - #314
Open
syf2211 wants to merge 1 commit into
Open
Conversation
Set HOST=127.0.0.1 in the service image entrypoint and Dockerfile so the MCP server listens on the same address NGINX proxies to. Without this, default HOST=localhost can resolve to ::1 on IPv6-enabled images while nginx.conf upstream targets 127.0.0.1, breaking the bundled container. Fixes firecrawl#251
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Set
HOST=127.0.0.1in the bundled Docker service image so the Node MCP server listens on the same IPv4 loopback address that NGINX proxies to.Motivation
Fixes #251. On IPv6-enabled images, the default
HOST=localhostcan resolve to::1, whiledocker/nginx.confupstream targets127.0.0.1:3000. That mismatch makes the provided container unreachable until users manually setHOST=127.0.0.1.Changes
docker/entrypoint.sh: exportHOST=${HOST:-127.0.0.1}before starting the Node process (runtime override still works)Dockerfile.service: document the default withENV HOST=127.0.0.1Tests
pnpm test— 9/9 passedNotes
HOSTbehavior is unchanged.CLOUD_SERVICE=truedeployments still bind0.0.0.0as before.