Fix a self-hosted docker-compose.yaml bug caused by a recent firecrawl change#2252
Merged
mogery merged 1 commit intofirecrawl:mainfrom Oct 5, 2025
Merged
Fix a self-hosted docker-compose.yaml bug caused by a recent firecrawl change#2252mogery merged 1 commit intofirecrawl:mainfrom
mogery merged 1 commit intofirecrawl:mainfrom
Conversation
…l change Add EXTRACT_WORKER_PORT to docker-compose environment
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a Docker Compose configuration bug by adding the missing EXTRACT_WORKER_PORT environment variable that was required by a recent Firecrawl change.
- Adds EXTRACT_WORKER_PORT environment variable with default port 3004
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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.
Add EXTRACT_WORKER_PORT to docker-compose environment
The Original Error
The Firecrawl container was failing to start with this error:
The API service was crashing because port 3002 was already occupied by another service inside the same container.
Root Cause Analysis
After extracting and analyzing the compiled JavaScript from inside the container, I discovered a port configuration mismatch:
The
extract-workerservice (/app/dist/src/services/extract-worker.js) checks for the environment variableEXTRACT_WORKER_PORT:The variable wasn't set, so it fell back to the global
PORTenvironment variable, which was set to3002Race condition: The harness script spawns multiple services concurrently:
extract-workerstarted first and successfully bound to port 3002apiservice tried to start and also bind to port 3002EADDRINUSEerror because the port was already takenAdditional conflict discovered: The
WORKER_PORTwas set to 3005, but the harness script was also trying to configure extract-worker to use port 3005 via a different variable name (NUQ_WORKER_PORT), which wasn't being read by the code.The Fix
Set unique ports for each service by adding the missing environment variable:
Final port allocation:
3002(viaPORT)3004(viaEXTRACT_WORKER_PORT)3005(viaWORKER_PORT)3006-3010(viaNUQ_WORKER_PORT)This ensures each service inside the container binds to its own dedicated port without conflicts.