The Docker Build System manages the creation, tagging, and publishing of multi-architecture container images for Langflow to Docker Hub and GitHub Container Registry (GHCR). It supports several image variants ranging from minimal backend-only builds to comprehensive images containing all optional dependencies.
The system is primarily orchestrated via specialized Dockerfiles located in the docker/ directory. It leverages uv for Python dependency management and npm for frontend compilation within the multi-stage build process.
Langflow Docker images are built corresponding to the primary packages in the monorepo workspace:
| Package | Description | Primary Use Case |
|---|---|---|
lfx | Minimal executor with core graph execution logic. | Lightweight deployment, embedded execution. |
langflow-base | Backend core including FastAPI, database services, and LangChain integrations. | Backend-only deployments or custom frontends. |
langflow | Full application including the React-based frontend and all core components. | Standard Langflow application deployment. |
Sources: pyproject.toml1-10 src/backend/base/pyproject.toml1-10 src/lfx/pyproject.toml1-10
The build system produces several functional variants of the langflow image to accommodate different infrastructure requirements. All modern variants use the Red Hat Universal Base Image (ubi10/python-314-minimal) as the foundation.
| Image Variant | Dockerfile | Description |
|---|---|---|
| Standard | docker/build_and_push.Dockerfile | The default image containing both frontend and backend. docker/build_and_push.Dockerfile1-137 |
| Base | docker/build_and_push_base.Dockerfile | Minimal image derived from langflow-base. Preserves the lean image boundary by ignoring bundle wheels. docker/build_and_push_base.Dockerfile80-94 |
| Entrypoint | docker/build_and_push_ep.Dockerfile | Variant with nv-ingest extras and specialized polling event delivery. docker/build_and_push_ep.Dockerfile117-147 |
| All-Extras | docker/build_and_push_with_extras.Dockerfile | Includes couchbase, cassio, local, clickhouse-connect, and nv-ingest. docker/build_and_push_with_extras.Dockerfile58-59 |
| Backend-Only | docker/build_and_push_backend.Dockerfile | Minimal runtime without frontend assets. Uses uv pip to install the base core only. docker/build_and_push_backend.Dockerfile45-54 |
| Development | docker/dev.Dockerfile | Used for local development, exposing ports 7860 and 3000. docker/dev.Dockerfile1-36 |
Sources: docker/build_and_push.Dockerfile1-137 docker/build_and_push_base.Dockerfile1-100 docker/build_and_push_ep.Dockerfile1-147 docker/build_and_push_with_extras.Dockerfile1-158 docker/build_and_push_backend.Dockerfile1-126 docker/dev.Dockerfile1-36
Langflow supports multi-arch builds (primarily amd64 and arm64) by dynamically resolving dependencies and binaries during the build process.
uname -m to support dependencies like MCP servers. docker/build_and_push.Dockerfile37-43--platform=$BUILDPLATFORM in the base image to ensure that architecture-specific binaries (like pydantic-core) are resolved correctly for the target architecture. docker/build_and_push.Dockerfile9-10esbuild to use the JS implementation (ESBUILD_BINARY_PATH="") and limits concurrency (JOBS=1) to prevent crashes. docker/build_and_push_base.Dockerfile70-76install_release_wheels.py is used to replace source installations with exact wheels built for PyPI, ensuring metadata consistency. docker/build_and_push.Dockerfile92-97Sources: docker/build_and_push.Dockerfile9-10 docker/build_and_push.Dockerfile37-43 docker/build_and_push.Dockerfile92-97 docker/build_and_push_base.Dockerfile70-76
The standard docker/build_and_push.Dockerfile implements a multi-stage pattern to optimize the final image size.
registry.access.redhat.com/ubi10/python-314-minimal. docker/build_and_push.Dockerfile13uv for high-speed dependency resolution. docker/build_and_push.Dockerfile15-16uv sync --frozen with --extra postgresql. docker/build_and_push.Dockerfile65-67npm run build and moves them to the backend directory. docker/build_and_push.Dockerfile71-80registry.access.redhat.com/ubi10/python-314-minimal. docker/build_and_push.Dockerfile103npx-based MCP (Model Context Protocol) servers. docker/build_and_push.Dockerfile111-121/app/langflow and /app/.npm with proper ownership to prevent PermissionError when mounting volumes. docker/build_and_push.Dockerfile122-150Sources: docker/build_and_push.Dockerfile1-150
This diagram illustrates how the Docker build process translates high-level stages into specific code entities and commands.
Sources: docker/build_and_push.Dockerfile65-113 docker/build_and_push_backend.Dockerfile36-54
The Dockerfiles define critical environment variables for containerized operation:
LANGFLOW_HOST=0.0.0.0: Binds the FastAPI server to all interfaces. docker/build_and_push.Dockerfile162LANGFLOW_PORT=7860: Standard port for the Langflow UI and API. docker/build_and_push.Dockerfile163UV_COMPILE_BYTECODE=1: Compiles Python to .pyc during build for faster startup. docker/build_and_push.Dockerfile22NPM_CONFIG_CACHE=/app/.npm: Ensures the runtime user has a writable cache for npx operations. docker/build_and_push.Dockerfile147LANGFLOW_EVENT_DELIVERY=polling: Configured specifically in the Entrypoint variant. docker/build_and_push_ep.Dockerfile140Sources: docker/build_and_push.Dockerfile22-163 docker/build_and_push_ep.Dockerfile140
The repository provides multiple Docker Compose configurations for different deployment scenarios.
deploy/)A complex stack utilizing Traefik as a reverse proxy, Celery workers, and monitoring tools.
traefik:v3.0 with labels to handle domain routing and HTTPS redirection. deploy/docker-compose.yml2-67backend and celeryworker services share a common base configuration, including database and broker dependencies. deploy/docker-compose.yml69-85 deploy/docker-compose.yml133-142redis for result caching and rabbitmq (broker) for task distribution. deploy/docker-compose.yml124-132 deploy/.env.example45-46flower for Celery task monitoring and pgadmin for database management. deploy/docker-compose.yml101-122 deploy/docker-compose.yml143-157Sources: deploy/docker-compose.yml1-157 deploy/docker-compose.override.yml1-66 deploy/.env.example1-53
The frontend Docker image uses Nginx to serve static files and proxy API requests to the backend. The docker/frontend/nginx.conf and docker/frontend/default.conf.template files define this behavior.
The nginx.conf file docker/frontend/nginx.conf1-34 configures Nginx to:
__FRONTEND_PORT__). docker/frontend/nginx.conf10/usr/share/nginx/html. docker/frontend/nginx.conf13/api, /health_check, and /health to the __BACKEND_URL__. docker/frontend/nginx.conf19-30The default.conf.template docker/frontend/default.conf.template1-55 provides a templated version allowing environment variables like FRONTEND_PORT and BACKEND_URL to be injected at runtime. It also sets client_max_body_size for file uploads. docker/frontend/default.conf.template8
Sources: docker/frontend/nginx.conf1-34 docker/frontend/default.conf.template1-55
The GitHub Actions workflows manage version-aware builds for standard releases and nightly snapshots.
The system ensures that built images match the version declared in the source code metadata.
docker_test.yml workflow extracts the version from pyproject.toml. .github/workflows/docker_test.yml65get_version_info() inside the container and comparing it to the repository's expected version. .github/workflows/docker_test.yml66-71docker buildx prune -af is performed between test stages to manage disk space on self-hosted runners. .github/workflows/docker_test.yml40-44Refresh this wiki
This wiki was recently refreshed. Please wait 5 days to refresh again.