This setup allows you to run Langflow using Docker while building from your local code instead of relying on pre-built images.
./run-scale.sh# 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| Service | Port | Description |
|---|---|---|
| Langflow | 7860 | Main application (http://localhost:7860) |
| PostgreSQL | 5432 | Database (localhost:5432) |
- Superuser:
langflow - Password:
langflow - Database:
langflow
# 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- Make code changes in your local
src/directory - Rebuild the image to include your changes:
docker-compose -f docker-compose.scale.yml build --no-cache
- Restart the service:
docker-compose -f docker-compose.scale.yml up -d
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- 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
- Reset database:
docker-compose -f docker-compose.scale.yml down -v - Check database logs:
docker-compose -f docker-compose.scale.yml logs postgres
If ports 7860 or 5432 are already in use, modify the ports in docker-compose.scale.yml:
├── 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