Skip to content

eual8/n8n-docker-compose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

38 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

n8n Docker Compose Stack

A complete Docker Compose setup for running n8n automation workflows with integrated AI services and document processing capabilities.

πŸš€ Quick Start

Prerequisites

  • Docker and Docker Compose installed
  • At least 4GB RAM available (for AI models)
  • 10GB free disk space

1. Clone and Start

git clone <repository-url>
cd n8n-docker-compose

Start the default (basic) set (ytdlp, whisper, n8n):

docker-compose up -d --build

Start the full set (all services):

docker-compose --profile full up -d --build

2. Access n8n

3. Import Sample Workflow

  1. In n8n, go to Workflows β†’ Import from File
  2. Upload workflows/Text File to Elasticsearch Indexer - Working Version.json
  3. Activate the workflow

🎯 What is this repository?

This repository provides a ready-to-use Docker Compose stack that includes:

  • n8n - No-code automation platform for building workflows
  • Elasticsearch - Search and analytics engine for document indexing
  • Ollama - Local LLM inference server for AI capabilities
  • LaBSE - Multilingual text embeddings service (109 languages supported)
  • YT-DLP - YouTube and video platform downloader with REST API
  • Whisper - Audio transcription service using OpenAI Whisper (faster-whisper)

🎯 Why use this stack?

This setup is ideal for:

  • Document Processing & Search: Upload text files, automatically split them into paragraphs, and index them in Elasticsearch for semantic search
  • AI-Powered Workflows: Leverage local LLM models through Ollama for text processing, analysis, and generation
  • Multilingual Text Analysis: Use LaBSE embeddings for cross-language semantic similarity and search
  • Audio Transcription: Convert audio files to text using state-of-the-art Whisper models
  • No-Code Automation: Build complex workflows without programming using n8n's visual interface
  • Privacy-First AI: All AI processing happens locally β€” no data sent to external APIs

πŸ“‹ Services Overview

Service Port Purpose Access
n8n 5678 Workflow automation platform http://localhost:5678
Elasticsearch - Document search and analytics Internal (via Docker network)
Ollama - Local LLM inference server Internal (via Docker network)
LaBSE - Multilingual embeddings API Internal (via Docker network)
YT-DLP - YouTube video/audio downloader Internal (via Docker network)
Whisper - Audio transcription service Internal (via Docker network)

Note: Ports for services other than n8n are not forwarded to localhost to avoid conflicts. They are accessible from n8n or other containers via the Docker network.

🎬 Ready-to-Use Workflows

YouTube Video Transcription (Manual)

Automatically transcribe YouTube videos to text:

  1. Open n8n: http://localhost:5678 (login: admin / password)
  2. Find workflow: "YouTube Video Transcription (Manual)"
  3. Edit URL: Open the "Enter YouTube URL" node and paste your YouTube link
  4. Run: Click "Execute workflow"
  5. Get result: View the transcription in the "Format Response" node

πŸ“– Full instructions: See workflows/QUICK_START.md

Features:

  • βœ… Simple form-based input
  • βœ… Automatic audio extraction
  • βœ… Multi-language support (auto-detect or specify)
  • βœ… Timestamped segments
  • βœ… Multiple Whisper models (tiny to large)

πŸ“Š Sample Workflow: Text File Indexer

The included workflow demonstrates the stack's capabilities:

  1. File Upload: Web form for uploading text files
  2. Text Processing: Automatically splits content into paragraphs
  3. Elasticsearch Indexing: Stores processed documents with metadata
  4. Batch Processing: Handles large files efficiently

How to use:

  1. Activate the "Text File to Elasticsearch Indexer" workflow
  2. Open the webhook URL provided by the form trigger
  3. Upload a .txt file
  4. Documents will be automatically indexed in Elasticsearch

πŸ”§ Service Details

n8n Configuration

  • Basic authentication enabled
  • Persistent data storage
  • Connected to other services via Docker network
  • Production-oriented settings for local development

Elasticsearch

  • Single-node setup
  • No authentication (for local development)
  • Persistent data volume
  • Optimized for document storage

Ollama

  • Ready for LLM model installation
  • Persistent model storage
  • GPU acceleration supported if available

LaBSE Embeddings

  • FastAPI-based service
  • Supports 109 languages
  • 768-dimensional embeddings
  • Batch processing capable

YT-DLP Service

  • Download videos from YouTube and 1000+ sites
  • Extract audio in MP3 format
  • Return video metadata and transcripts
  • REST API for easy integration

Whisper Transcription

  • Audio-to-text transcription using faster-whisper
  • Supports multiple audio formats (MP3, WAV, M4A, OGG, FLAC, WebM)
  • Automatic language detection
  • Multiple model sizes (tiny, base, small, medium, large)
  • Timestamp generation for each segment
  • Optional translation to English

πŸ“š Usage Examples

Generate Embeddings (requires --profile full)

curl -X POST http://localhost:8080/embeddings \
  -H "Content-Type: application/json" \
  -d '{"texts": ["Hello world", "ΠŸΡ€ΠΈΠ²Π΅Ρ‚ ΠΌΠΈΡ€", "Hola mundo"]}'

Search Elasticsearch (requires --profile full)

curl -X GET "http://localhost:9200/documents/_search?q=your_search_term"

Install Ollama Models (requires --profile full)

docker exec -it ollama ollama pull llama2

Download YouTube Video (available in the basic set)

curl -X POST http://localhost:8081/download \
  -H "Content-Type: application/json" \
  -d '{"url": "https://www.youtube.com/watch?v=VIDEO_ID", "format": "video", "quality": "best"}'

Download YouTube Audio (MP3) (available in the basic set)

curl -X POST http://localhost:8081/download \
  -H "Content-Type: application/json" \
  -d '{"url": "https://www.youtube.com/watch?v=VIDEO_ID", "format": "audio"}'

Transcribe Audio File (available in the basic set)

# Basic transcription
curl -X POST http://localhost:8082/transcribe \
  -F "file=@audio.mp3"

# With specific model and language
curl -X POST http://localhost:8082/transcribe \
  -F "file=@audio.mp3" \
  -F "model=small" \
  -F "language=ru"

# Translate to English
curl -X POST http://localhost:8082/transcribe \
  -F "file=@audio.mp3" \
  -F "translate=true"

πŸ” API Documentation

  • LaBSE API: http://localhost:8080/docs (requires --profile full)
  • YT-DLP API: See docker/ytdlp/README.md for full API documentation
  • Whisper API: See docker/whisper/README.md for full API documentation
  • Elasticsearch: http://localhost:9200 (requires --profile full)
  • n8n Webhooks: Available through workflow triggers

πŸ’Ύ Data Persistence

All data is persisted in Docker volumes:

  • n8n_data - n8n workflows and settings
  • esdata - Elasticsearch indices
  • ollama_data - Downloaded LLM models
  • labse_cache - Cached embedding models
  • ytdlp_downloads - Downloaded videos and audio files
  • ytdlp_cache - yt-dlp cache
  • whisper_cache - Whisper models cache

πŸš€ Advanced Usage

Custom Workflows

Create workflows that combine:

  • File processing with LaBSE embeddings
  • AI text generation with Ollama
  • Document search with Elasticsearch
  • Web scraping and data transformation
  • Download YouTube videos with YT-DLP and transcribe with Whisper
  • Audio transcription and text analysis with Ollama

Scaling

  • Add more Elasticsearch nodes for clustering
  • Use external GPU for Ollama acceleration
  • Deploy behind reverse proxy for production

πŸ›  Troubleshooting

Common Issues

Services not starting?

  • Check Docker logs: docker-compose logs [service-name]
  • Ensure ports are not in use
  • Verify sufficient disk space and RAM

n8n workflows failing?

  • Check service connectivity between containers
  • Verify Elasticsearch is ready before running workflows
  • Check webhook URLs and credentials

LaBSE model loading slowly?

  • First request downloads ~1.8GB model
  • Subsequent requests are fast
  • Model is cached in volume

πŸ“ Default Credentials

  • n8n: admin / password
  • Elasticsearch: No authentication
  • Other services: No authentication (local development)

🀝 Contributing

Feel free to:

  • Add new workflows to the workflows/ directory
  • Improve service configurations
  • Add new AI services or tools
  • Submit issues and pull requests

πŸ“„ License

This project is provided as-is for educational and development purposes.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published