services:
n8n:
image: n8nio/n8n:latest
container_name: n8n-fabric-n8n
restart: unless-stopped
ports:
- "5678:5678"
environment:
- N8N_HOST=0.0.0.0
- N8N_PORT=5678
- N8N_PROTOCOL=http
- NODE_ENV=production
- N8N_SECURE_COOKIE=false
- N8N_ENCRYPTION_KEY=${N8N_ENCRYPTION_KEY:-change-me-in-production}
# Enable API
- N8N_PUBLIC_API_DISABLED=false
# Webhook URL for external access
- WEBHOOK_URL=http://localhost:5678/
# Database
- DB_TYPE=postgresdb
- DB_POSTGRESDB_HOST=postgres
- DB_POSTGRESDB_PORT=5432
- DB_POSTGRESDB_DATABASE=n8n
- DB_POSTGRESDB_USER=n8n
- DB_POSTGRESDB_PASSWORD=${POSTGRES_PASSWORD:-n8n_password}
volumes:
- n8n_data:/home/node/.n8n
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:5678/healthz"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
postgres:
image: postgres:16-alpine
container_name: n8n-fabric-postgres
restart: unless-stopped
environment:
- POSTGRES_DB=n8n
- POSTGRES_USER=n8n
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-n8n_password}
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U n8n -d n8n"]
interval: 10s
timeout: 5s
retries: 5
qdrant:
image: qdrant/qdrant:latest
container_name: n8n-fabric-qdrant
restart: unless-stopped
ports:
- "6343:6333"
- "6344:6334"
volumes:
- qdrant_data:/qdrant/storage
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:6333/healthz"]
interval: 30s
timeout: 10s
retries: 3
redis:
image: redis:7-alpine
container_name: n8n-fabric-redis
restart: unless-stopped
command: redis-server --appendonly yes
ports:
- "6389:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 3
volumes:
n8n_data:
postgres_data:
qdrant_data:
redis_data: