Add Docker networking support for N8N and container integration

- Added docker-compose.api-localai.yml for Docker network integration
- Updated config.py to support dynamic Supabase connection strings via environment variables
- Enhanced documentation with Docker network deployment instructions
- Added specific N8N workflow integration guidance
- Solved Docker networking issues for container-to-container communication

Key improvements:
* Container-to-container API access for N8N workflows
* Automatic service dependency resolution (Ollama, Supabase)
* Comprehensive deployment options for different use cases
* Production-ready Docker network configuration

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Docker Config Backup
2025-08-01 08:25:25 +02:00
parent e55c38bc7f
commit 710adff0aa
6 changed files with 75 additions and 3 deletions

View File

@@ -97,6 +97,28 @@ Mem0 provides a comprehensive REST API server built with FastAPI. The implementa
The Docker deployment automatically configures external access on `0.0.0.0:8080`.
</Note>
</Tab>
<Tab title="Docker Network Integration ✅ For N8N & Container Services">
For integration with N8N workflows or other containerized services:
```bash
# Deploy to existing Docker network (e.g., localai)
docker-compose -f docker-compose.api-localai.yml up -d
# Find the container IP address
docker inspect mem0-api-localai --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}'
```
**Usage in N8N HTTP Request Node:**
- **URL**: `http://172.21.0.17:8080/v1/memories` (use actual container IP)
- **Method**: POST
- **Headers**: `Authorization: Bearer mem0_dev_key_123456789`
- **Body**: JSON object with `messages`, `user_id`, and `metadata`
<Note>
**Perfect for Docker ecosystems!** Automatically handles Ollama and Supabase connections within the same network. Use container IP addresses for reliable service-to-service communication.
</Note>
</Tab>
</Tabs>
## API Endpoints