Skip to content
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

docs: clean up and test deployment documentation #6029

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 58 additions & 32 deletions docs/docs/Deployment/deployment-docker.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,24 @@
---
title: Docker
mendonk marked this conversation as resolved.
Show resolved Hide resolved
lug: /deployment-docker
slug: /deployment-docker
---

This guide will help you get Langflow up and running using Docker and Docker Compose.
mendonk marked this conversation as resolved.
Show resolved Hide resolved


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


## Prerequisites {#856bb2d98156402bbd1980365b98110c}
- [Docker](https://docs.docker.com/)
- [Docker Compose](https://docs.docker.com/compose/)


---

- Docker
- Docker Compose

## Docker {#55b5d304f2294e47b0dcd3e069cf5e67}


---


### Clone repo and build Docker container {#ba89773aa8b8425b985bfe7ba91c35cc}
## Clone the repo and build the Langflow Docker container

1. Clone the LangFlow repository:

`git clone https://github.com/langflow-ai/langflow.git`

2. Navigate to the `docker_example` directory:
2. Navigate to the `docker_example` directory:

`cd langflow/docker_example`

Expand All @@ -37,20 +27,16 @@ This guide will help you get LangFlow up and running using Docker and Docker Com
`docker compose up`


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


### Docker Compose configuration {#02226209cad24185a6ec5b69bd820d0f}

Langflow will now be accessible at `http://localhost:7860/`.
mendonk marked this conversation as resolved.
Show resolved Hide resolved

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

## Configure Docker Compose

### LangFlow service {#d749848451ea43bd86f6f096dc77e6e6}
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.

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

Environment variables:

Expand All @@ -59,12 +45,12 @@ Environment variables:

Volumes:

- `langflow-data`: This volume is mapped to `/app/langflow` in the container.
- `langflow-data`: This volume is mapped to `/app/langflow` in the container.

### PostgreSQL service {#121140decbfe4997b12213bdd2c4da7e}
### PostgreSQL service


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


Environment variables:
Expand All @@ -75,10 +61,50 @@ Environment variables:

Volumes:

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


### Deploy a specific Langflow version
mendonk marked this conversation as resolved.
Show resolved Hide resolved


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`.

## Package your flow as a Docker image

An example flow is available in the [Langflow Helm Charts](https://github.com/langflow-ai/langflow-helm-charts/tree/main/examples/flows) repository, or you can provide your own `.JSON` file.

1. Create a project directory:
```shell
mkdir langflow-custom && cd langflow-custom
```

2. Download the example flow or provide your own `.JSON` file.

```shell
wget https://raw.githubusercontent.com/langflow-ai/langflow-helm-charts/refs/heads/main/examples/flows/basic-prompting-hello-world.json
```

3. Create a Dockerfile:
```dockerfile
FROM langflowai/langflow:latest
RUN mkdir /app/flows
COPY ./*json /app/flows/.
```
The `COPY ./*json` command copies all JSON files in your current directory to the flows folder.


### Switch to a specific LangFlow version {#2b3e191ea48f4feab89242433cf012d5}
4. Build and run the image locally.
```shell
docker build -t myuser/langflow-hello-world:1.0.0 .
docker run -p 7860:7860 myuser/langflow-hello-world:1.0.0
```

5. Build and push the image to Docker Hub.
Replace `myuser` with your Docker Hub username.
```shell
docker build -t myuser/langflow-hello-world:1.0.0 .
docker push myuser/langflow-hello-world:1.0.0
```

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`.
To deploy the image with Helm, see [Langflow runtime deployment](/deployment-kubernetes#langflow-runtime).

21 changes: 5 additions & 16 deletions docs/docs/Deployment/deployment-hugging-face-spaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,19 @@ title: HuggingFace Spaces
slug: /deployment-hugging-face-spaces
mendonk marked this conversation as resolved.
Show resolved Hide resolved
---



## HuggingFace Spaces {#00f5b3a6818d496dbb18e1a6a910e57d}


---


HuggingFace provides a great alternative for running Langflow in their Spaces environment. This means you can run Langflow in the cloud without any local installation required. Here's how you can get Langflow up and running on HuggingFace Spaces:

Run Langflow in a [HuggingFace Spaces](https://huggingface.co/spaces/) environment with no local installation required.

1. **Access Langflow Space**: Open a Chromium-based browser and navigate to the [Langflow Space](https://huggingface.co/spaces/Langflow/Langflow?duplicate=true). This link directs you to a pre-configured environment for Langflow.

2. **Duplicate the Space**: You'll encounter an option to duplicate the Langflow space.

2. **Duplicate the Space**: You'll encounter an option to duplicate the Langflow space. This step involves a few simple decisions:

- **Naming Your Space**: Assign a unique name to your new Space.
- **Name Your Space**: Assign a unique name to your new Space.
- **Visibility Settings**: Choose between Public or Private visibility for your Space.
- After setting these parameters, click on **Duplicate Space** to initiate the setup.

![](/img/hugging-face-deployment.png)

3. **Complete Installation**: The duplication and setup process begins immediately after you click **Duplicate Space**. Once completed, you will be automatically redirected to the main page of your new Space.

3. **Complete Installation**: Click **Duplicate Space**. Once completed, you will be automatically redirected to the main page of your new Space.
mendonk marked this conversation as resolved.
Show resolved Hide resolved

4. **Start Exploring Langflow**: With the setup complete, Langflow is now ready for use in your Space and you can start exploring its features and capabilities right away!
4. **Explore Langflow**: Langflow is now ready for use in your Space. Start exploring with the [Quickstart](/get-started-quickstart)

Loading
Loading