Skip to content

[FEATURE] Official Dockerfile and Image for Flowise Workers #4345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
nikitas-novatix opened this issue Apr 25, 2025 · 2 comments
Open

[FEATURE] Official Dockerfile and Image for Flowise Workers #4345

nikitas-novatix opened this issue Apr 25, 2025 · 2 comments
Labels
setup Setup related issues

Comments

@nikitas-novatix
Copy link
Contributor

nikitas-novatix commented Apr 25, 2025

Describe the feature you'd like
Provide an official dockerfile.worker and a corresponding published Docker Hub image (e.g., flowiseai/flowise-worker) specifically for running Flowise workers. This would standardize and simplify deploying Flowise in scaled environments where the UI/API server and workers are separate processes.

Additional context
Running workers separately requires users to create custom Dockerfiles.
When deploying to Azure App Service:

  • The standard flowiseai/flowise image is designed to run the UI/API server (its default command is effectively flowise start).
  • Azure App Service provides a "Startup Command" field to override the image's default command.
  • However, simply putting flowise worker in the App Service "Startup Command" often does not work reliably with the standard image. The platform's override mechanism can conflict with the image's existing ENTRYPOINT or CMD, which is built assuming flowise start. This frequently results in the container failing to start the worker process correctly.

A dedicated Dockerfile.worker with flowise worker set as its primary command/entrypoint avoids these platform-specific override conflicts entirely. It ensures the container is built specifically for the worker role, leading to more robust and predictable deployments.
I have successfully tested the following Dockerfile.worker in an Azure, confirming it resolves the startup command issue:

FROM node:20-alpine AS build

USER root

# Skip downloading Chrome for Puppeteer (saves build time)
ENV PUPPETEER_SKIP_DOWNLOAD=true

# Install latest Flowise globally (specific version can be set: flowise@1.0.0)
RUN npm install -g flowise

# Stage 2: Runtime stage
FROM node:20-alpine

# Install runtime dependencies
RUN apk add --no-cache chromium git python3 py3-pip make g++ build-base cairo-dev pango-dev curl

# Set the environment variable for Puppeteer to find Chromium
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser

# Copy Flowise from the build stage
COPY --from=build /usr/local/lib/node_modules /usr/local/lib/node_modules
COPY --from=build /usr/local/bin /usr/local/bin

# Add a healthcheck.js file 
WORKDIR /app
RUN echo 'const express = require("express"); \
const app = express(); \
app.get("/", (req, res) => res.send("Flowise Worker Healthy")); \
app.listen(3000, () => console.log("Healthcheck running on port 3000"));' > healthcheck.js

# Install express
RUN npm install express

# Modified entrypoint to run both the worker and healthcheck 
# Sets the default command to 'flowise worker' running a healthcheck script alongside
ENTRYPOINT ["/bin/sh", "-c", "node /app/healthcheck.js & flowise worker"]

This works. However, there is another Redis issue that needs to be adressed: #2186 that causes the Flowise main and workers app because there is no keepalive mechanism with the redis queue. That needs to be adressed as well.

@nikitas-novatix nikitas-novatix changed the title [FEATURE] **Describe the feature you'd like** A clear and concise description of what you would like Flowise to have. **Additional context** Add any other context or screenshots about the feature request here. [FEATURE] Official Dockerfile and Image for Flowise Workers Apr 25, 2025
@HenryHengZJ
Copy link
Contributor

We're using ECS to deploy service and workers, but we specify entryPoint = ["pnpm", "run", "start-worker"] and entryPoint = ["pnpm", "run", "start"] - that works well

@HenryHengZJ HenryHengZJ added the setup Setup related issues label Apr 27, 2025
@nikitas-novatix
Copy link
Contributor Author

We're using ECS to deploy service and workers, but we specify entryPoint = ["pnpm", "run", "start-worker"] and entryPoint = ["pnpm", "run", "start"] - that works well

@HenryHengZJ I tried that with Azure App Services using docker-compose deployment but it doesn't seem to work and is nearly impossible to debug (no logs).

Would you mind if I made a PR with my Dockerfile.worker and updated the doc to specify it's to use for Azure App Service deployment ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
setup Setup related issues
Projects
None yet
Development

No branches or pull requests

2 participants