langflow/docker_example
Gabriel Luiz Freitas Almeida e7f1b9c881
Update dockerfiles and docker-build.yml (#2389)
* chore: Update docker-build.yml to disable pre-release by default

* chore: Update Dockerfiles to set LANGFLOW_HOST and LANGFLOW_PORT

The Dockerfiles have been updated to set the environment variables LANGFLOW_HOST and LANGFLOW_PORT. This ensures that the correct host and port are used when running the langflow application.

* 🔧 (build_and_push_backend.Dockerfile): remove unnecessary host and port configuration to simplify the Dockerfile and focus on backend-only functionality

* chore: Update LANGFLOW_CONFIG_DIR in docker-compose.yml

The LANGFLOW_CONFIG_DIR environment variable in docker-compose.yml has been updated to /app/langflow. This change ensures that the correct directory is used for storing logs, file storage, monitor data, and secret keys.
2024-06-27 04:24:35 -07:00
..
docker-compose.yml Update dockerfiles and docker-build.yml (#2389) 2024-06-27 04:24:35 -07:00
Dockerfile Update Docker image references to langflowai in GitHub workflows and Docker Compose files (#1793) 2024-04-29 13:38:18 -03:00
pre.docker-compose.yml chore: Update docker volume mount path for langflow-data in pre.docker-compose.yml 2024-05-28 20:46:46 -03:00
pre.Dockerfile Update Docker image references to langflowai in GitHub workflows and Docker Compose files (#1793) 2024-04-29 13:38:18 -03:00
README.md Update Docker image references to langflowai in GitHub workflows and Docker Compose files (#1793) 2024-04-29 13:38:18 -03:00

Running LangFlow with Docker

This guide will help you get LangFlow up and running using Docker and Docker Compose.

Prerequisites

  • Docker
  • Docker Compose

Steps

  1. Clone the LangFlow repository:

    git clone https://github.com/langflow-ai/langflow.git
    
  2. Navigate to the docker_example directory:

    cd langflow/docker_example
    
  3. Run the Docker Compose file:

    docker compose up
    

LangFlow will now be accessible at http://localhost:7860/.

Docker Compose Configuration

The Docker Compose configuration spins up two services: langflow and postgres.

LangFlow Service

The langflow service uses the langflowai/langflow:latest Docker image and exposes port 7860. It depends on the postgres service.

Environment variables:

  • LANGFLOW_DATABASE_URL: The connection string for the PostgreSQL database.
  • LANGFLOW_CONFIG_DIR: The directory where LangFlow stores logs, file storage, monitor data, and secret keys.

Volumes:

  • langflow-data: This volume is mapped to /var/lib/langflow in the container.

PostgreSQL Service

The postgres service uses the postgres:16 Docker image and exposes port 5432.

Environment variables:

  • POSTGRES_USER: The username for the PostgreSQL database.
  • POSTGRES_PASSWORD: The password for the PostgreSQL database.
  • POSTGRES_DB: The name of the PostgreSQL database.

Volumes:

  • langflow-postgres: This volume is mapped to /var/lib/postgresql/data in the container.

Switching to a Specific LangFlow Version

If you want to use a specific version of LangFlow, you can modify the image field under the langflow service in the Docker Compose file. For example, to use version 1.0-alpha, change langflowai/langflow:latest to langflowai/langflow:1.0-alpha.