Feature: Add dedicated Dockerfile.worker and queue-mode docker-compose setup #4389
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.
Problem:
Running Flowise workers effectively in various environments, especially scaled deployments or platforms like Azure App Service, presents several challenges:
Dockerfilespecifically designed for running Flowise worker instances.flowiseai/flowiseimage as a worker on platforms like Azure App Service by overriding the startup command (e.g., toflowise worker) often fails. This is due to conflicts with the main image's existingENTRYPOINTorCMD, which is tailored forflowise start. This results in unreliable worker startup and makes debugging difficult.This work is related to #4345.
Solution:
This PR introduces two main components to address these problems and standardize worker deployment:
New Dedicated Worker Dockerfile (
docker/worker/Dockerfile.worker):Dockerfile.workerhas been created, specifically for building Flowise worker instances.flowise worker.docker/worker/healthcheck/healthcheck.js) which runs as a background "keep-alive" service within the worker container. This is particularly beneficial for environments like Azure App Service, which might terminate containers not perceived as actively serving HTTP traffic. This internal healthcheck ensures the container remains running and the worker process is active.New Comprehensive Docker Compose for Queue Mode (
docker/docker-compose.queue.yml):docker-compose.queue.ymlfile is provided to offer a minimal, all-in-one setup for running and testing Flowise in queue mode locally.flowise: The main Flowise application (built fromdocker/Dockerfile).flowise-worker: The worker instance (built using the newdocker/worker/Dockerfile.worker).redis: The Redis message queue.docker-compose -f docker/docker-compose.queue.yml up --build(run from the project root).Proposal for Official Docker Hub Image:
To ensure users have access to a consistently updated and tested image, I propose that an official Docker image be built from
docker/worker/Dockerfile.workerand published to Docker Hub (e.g., asflowiseai/flowise-worker). This would align with the mainflowiseai/flowiseimage and make deploying worker nodes significantly easier.Testing:
docker/docker-compose.queue.ymlsetup has been successfully tested locally, confirming that all services (redis,flowise-main,flowise-worker) start correctly and Flowise operates in queue mode as expected.docker/worker/Dockerfile.worker, with its dedicatedflowise workerentrypoint and internal healthcheck/keep-alive script, has been tested both locally and on Azure App Service (with a custom image published to Docker Hub).Closes:
#4345