Skip to content

Latest commit

 

History

History
105 lines (76 loc) · 2.64 KB

File metadata and controls

105 lines (76 loc) · 2.64 KB

Running Langflow from Local Code with Docker (Scale Setup)

This setup allows you to run Langflow using Docker while building from your local code instead of relying on pre-built images.

Quick Start

Option 1: Using the convenience script

./run-scale.sh

Option 2: Manual Docker Compose commands

# Build the image from local code
docker-compose -f docker-compose.scale.yml build

# Start the services
docker-compose -f docker-compose.scale.yml up -d

Services

Service Port Description
Langflow 7860 Main application (http://localhost:7860)
PostgreSQL 5432 Database (localhost:5432)

Default Credentials

  • Superuser: langflow
  • Password: langflow
  • Database: langflow

Useful Commands

# View logs
docker-compose -f docker-compose.scale.yml logs -f

# View logs for specific service
docker-compose -f docker-compose.scale.yml logs -f langflow

# Stop services
docker-compose -f docker-compose.scale.yml down

# Rebuild image (after code changes)
docker-compose -f docker-compose.scale.yml build --no-cache

# Access container shell
docker exec -it langflow-scale bash

# View running containers
docker-compose -f docker-compose.scale.yml ps

Development Workflow

  1. Make code changes in your local src/ directory
  2. Rebuild the image to include your changes:
    docker-compose -f docker-compose.scale.yml build --no-cache
  3. Restart the service:
    docker-compose -f docker-compose.scale.yml up -d

Environment Variables

You can customize the setup by creating a .env file or setting environment variables:

# Database
LANGFLOW_DATABASE_URL=postgresql://langflow:langflow@postgres:5432/langflow

# Admin credentials
LANGFLOW_SUPERUSER=langflow
LANGFLOW_SUPERUSER_PASSWORD=langflow

# Data storage
LANGFLOW_CONFIG_DIR=/app/data

Troubleshooting

Build Issues

  • Ensure Docker has enough memory (at least 4GB recommended)
  • Clear Docker cache: docker system prune -a
  • Check Docker logs: docker-compose -f docker-compose.scale.yml logs

Database Issues

  • Reset database: docker-compose -f docker-compose.scale.yml down -v
  • Check database logs: docker-compose -f docker-compose.scale.yml logs postgres

Port Conflicts

If ports 7860 or 5432 are already in use, modify the ports in docker-compose.scale.yml:

File Structure

├── docker-compose.scale.yml    # Docker Compose configuration
├── docker/scale.Dockerfile     # Dockerfile for scale builds
├── run-scale.sh               # Convenience script
└── DOCKER_SCALE_README.md     # This file