This directory contains the Docker Compose configuration for deploying Activeloop NeoHorizon, a comprehensive AI-powered document processing and analysis platform.
Activeloop NeoHorizon self-hosted docker-compose deployment with multiple configuration options for different deployment scenarios.
- Docker Engine 20.10+
- Docker Compose 2.0+
- At least 8GB RAM available
- NVIDIA GPU with CUDA support (optional, for model services)
-
Clone the repository and navigate to the docker-compose directory:
cd docker-compose/activeloop-neohorizon -
Set required environment variables:
# API key to use as Bearer token for authentication export AL_API_TOKEN="neohorizon-api-key-here" # API key for Gemini requests export GEMINI_API_KEY="your-gemini-api-key-here" # API key for OpenAI requests export OPENAI_API_KEY="your-openai-api-key-here"
-
Choose your deployment scenario:
# Start all services (recommended for full deployment) docker-compose up -d# Start only core services without model (for development/testing) docker-compose -f docker-compose.nomodel.yaml up -d# Start only the model service (for separate model deployment) docker-compose -f docker-compose.model.yaml up -d# Start only the application services (for production when Model, RMQ and Postgres are managed separately) docker-compose -f docker-compose.apps.yaml up -d -
Access the application:
- Main API:
http://localhost - RabbitMQ Management:
http://localhost:15672(username:neohorizon, password:neohorizon) - PostgreSQL: localhost:5432 (username:
postgres, password:postgres)
- Main API:
This directory contains multiple docker-compose files for different deployment scenarios:
- Purpose: Complete deployment with all services including model
- Use case: Full self-hosted deployment with local model inference
- Services: All application services, workers, model, RabbitMQ, PostgreSQL, and proxy
- Purpose: Deployment without the model service
- Use case: Development/testing or when using external model services
- Services: All application services, workers, RabbitMQ, PostgreSQL, and proxy
- Note: Requires external model service URLs to be configured
- Purpose: Standalone model service deployment
- Use case: Separate model deployment for scaling or resource isolation
- Services: Only the model service with exposed ports
- Ports: 8000 (HTTP), 8001 (gRPC), 8002 (metrics)
- Purpose: Application services only
- Use case: Production deployment with external managed services
- Services: All application services and workers, proxy
- Note: Requires external PostgreSQL, RabbitMQ, and model service URLs
- Image:
quay.io/activeloopai/neohorizon-main:${AL_IMAGE_TAG:-latest} - Port: 8000 (internal)
- Purpose: Main API service handling core application logic
- Access: Via nginx proxy at
/ - Health Check: HTTP endpoint
/health
- Image:
quay.io/activeloopai/neohorizon-files:${AL_IMAGE_TAG:-latest} - Port: 8000 (internal)
- Purpose: File management and processing service
- Access: Via nginx proxy at
/files - Health Check: HTTP endpoint
/health
- Image:
quay.io/activeloopai/neohorizon-main:${AL_IMAGE_TAG:-latest} - Purpose: Processes file uploads and conversions
- Scaling: Can be scaled horizontally
- Image:
quay.io/activeloopai/neohorizon-main:${AL_IMAGE_TAG:-latest} - Purpose: Generates embeddings for documents
- Scaling: Can be scaled horizontally
- Image:
quay.io/activeloopai/neohorizon-main:${AL_IMAGE_TAG:-latest} - Purpose: Handles vector search operations
- Scaling: Can be scaled horizontally
- Image:
quay.io/activeloopai/neohorizon-main:${AL_IMAGE_TAG:-latest} - Purpose: Generates document summaries
- Scaling: Can be scaled horizontally
- Image:
quay.io/activeloopai/models-triton:${AL_IMAGE_TAG_MODEL:-latest} - Port: 8000 (internal)
- Purpose: Provides visual and embedding model inference
- GPU: Requires NVIDIA GPU with CUDA support
- Access: Internal service, not directly exposed in main compose. Only exposed in docker-compose.model.yaml via
8000/HTTP,8001/GRPCand8002/http metricsports - SHM_SIZE: Configurable via
SHM_SIZEenvironment variable, default is8g
- Image:
rabbitmq:3-management - Ports:
- 5672 (AMQP) - bound to localhost only
- 15672 (Management UI) - bound to localhost only
- Purpose: Message queue for asynchronous processing
- Credentials:
neohorizon/neohorizon - Persistence: Volume
al_neohorizon_rabbitmq_data - Health Check: RabbitMQ service status
- Image:
postgres:17 - Port: 5432 - bound to localhost only
- Purpose: Primary database for application data
- Credentials:
postgres/postgres - Database:
neohorizon - Persistence: Volume
al_neohorizon_postgres_data - Health Check: Database readiness check
- Image:
nginx:latest - Port: Configurable via
LISTEN_PORT(default:80) - Host: Configurable via
LISTEN_HOST(default:0.0.0.0) - Purpose: Reverse proxy for API services
- Configuration: Routes
/filesto files-api and everything else to main-api - File Upload: Supports up to 512MB file uploads
| Variable | Description | Example |
|---|---|---|
AL_API_TOKEN |
API Bearer authentication token, this token has special format and can be copied from Activeloop platform UI | your-api-key |
GEMINI_API_KEY |
Google Gemini API key | your-gemini-key |
OPENAI_API_KEY |
OpenAI API key | your-openai-key |
| Variable | Description | Default |
|---|---|---|
AL_IMAGE_TAG |
Main application image tag | latest |
AL_IMAGE_TAG_MODEL |
Model service image tag | latest |
AL_MODEL_NAME |
Which model to serve | colnomic |
LISTEN_HOST |
Host interface for nginx proxy | 0.0.0.0 |
LISTEN_PORT |
Port for nginx proxy | 80 |
SHM_SIZE |
Shared memory size for model service | 8g |
POSTGRES_DATABASE |
PostgreSQL database name | neohorizon |
POSTGRES_HOST |
PostgreSQL host | al-neohorizon-postgres |
POSTGRES_PASSWORD |
PostgreSQL password | postgres |
POSTGRES_PORT |
PostgreSQL port | 5432 |
POSTGRES_USER |
PostgreSQL username | postgres |
RABBITMQ_URL |
RabbitMQ connection URL | amqp://neohorizon:neohorizon@al-neohorizon-rabbitmq:5672 |
VISUAL_MODEL_URL |
Visual model service URL | http://al-neohorizon-model:8000 |
EMBEDDING_MODEL_URL |
Embedding model service URL | http://al-neohorizon-model:8000 |
DEEPLAKE_ROOT_DIR |
Storage path for the NeoHorizon data | /var/lib/deeplake |
DEEPLAKE_CREDS |
DeepLake storage credentials (optional, for cloud storage) | N/A |
| Variable | Description | Example |
|---|---|---|
TEXT_IMAGE__MATRIX_OF_EMBEDDINGS__INGESTION_URL |
URL for text/image matrix embeddings ingestion | http://model-service:8000/v2/models/colnomic/infer |
TEXT_IMAGE__MATRIX_OF_EMBEDDINGS__QUERY_URL |
URL for text/image matrix embeddings query | http://model-service:8000/v2/models/colnomic/infer |
TEXT_IMAGE__EMBEDDING__INGESTION_URL |
URL for text/image embedding ingestion | http://model-service:8000/v2/models/colnomic/infer |
TEXT_IMAGE__EMBEDDING__QUERY_URL |
URL for text/image embedding query | http://model-service:8000/v2/models/colnomic/infer |
TEXT__EMBEDDING__INGESTION_URL |
URL for text embedding ingestion | http://model-service:8000/v2/models/colnomic/infer |
TEXT__EMBEDDING__QUERY_URL |
URL for text embedding query | http://model-service:8000/v2/models/colnomic/infer |
- Main deployment: All services run on a custom bridge network
al-neohorizon-network - Model-only deployment: Uses
al-neohorizon-model-network - Apps-only deployment: Uses
al-neohorizon-apps-network
- PostgreSQL Data Storage:
al_neohorizon_postgres_data - RabbitMQ Data Storage:
al_neohorizon_rabbitmq_data - DeepLake Default Data Storage:
al_neohorizon_deeplake_data
- Main API: HTTP health check every 30s
- Files API: HTTP health check every 30s
- RabbitMQ: Service status check every 30s
- PostgreSQL: Database readiness check every 30s
For the API usage please refer to NeoHorizon Documentation
# Set environment variables
export AL_API_TOKEN="your-api-key"
export GEMINI_API_KEY="your-gemini-key"
export OPENAI_API_KEY="your-openai-key"# Start all services
docker-compose up -d# Check service status
docker-compose ps# View logs
docker-compose logs -f main-api# Scale specific workers
docker-compose up -d --scale file_processor_worker=3 --scale embedding_worker=2# Update to specific image tags
export AL_IMAGE_TAG="v0.1.5"
export AL_IMAGE_TAG_MODEL="v0.1.5"
docker-compose pull
docker-compose up -d# Backup PostgreSQL data
docker-compose exec postgres pg_dump -U postgres neohorizon > backup.sql
# Restore PostgreSQL data
docker-compose exec -T postgres psql -U postgres neohorizon < backup.sql# Deploy model on a separate machine
export AL_MODEL_NAME="colnomic"
export SHM_SIZE="16g"
docker-compose -f docker-compose.model.yaml up -d
# Deploy applications with external model
export TEXT_IMAGE__MATRIX_OF_EMBEDDINGS__INGESTION_URL="http://model-host:8000/v2/models/colnomic/infer"
export TEXT_IMAGE__MATRIX_OF_EMBEDDINGS__QUERY_URL="http://model-host:8000/v2/models/colnomic/infer"
export TEXT_IMAGE__EMBEDDING__INGESTION_URL="http://model-host:8000/v2/models/colnomic/infer"
export TEXT_IMAGE__EMBEDDING__QUERY_URL="http://model-host:8000/v2/models/colnomic/infer"
export TEXT__EMBEDDING__INGESTION_URL="http://model-host:8000/v2/models/colnomic/infer"
export TEXT__EMBEDDING__QUERY_URL="http://model-host:8000/v2/models/colnomic/infer"
docker-compose -f docker-compose.nomodel.yaml up -d-
Services not starting:
# Check logs for specific service docker-compose logs service-name# Check all logs docker-compose logs -
Port conflicts:
- Ensure ports 80, 5432, 5672, and 15672 are available
- Modify port mappings in docker-compose.yaml if needed
- Note: PostgreSQL and RabbitMQ are bound to localhost only for security
-
GPU issues:
- Ensure NVIDIA Docker runtime is installed
- Check GPU availability:
nvidia-smi - Verify CUDA compatibility
- Increase
SHM_SIZEif model service fails to start
-
Memory issues:
- Increase Docker memory limit
- Reduce worker replicas
- Monitor resource usage:
docker stats - Set higher
SHM_SIZEand run docker compose restart if Model is on low memory
-
Model service connection issues:
- Verify model service URLs are correct when using nomodel or apps deployments
- Check network connectivity between services
- Ensure model service is running and accessible
-
External service configuration:
- When using apps.yaml, ensure all external service URLs are properly configured
- Verify PostgreSQL and RabbitMQ connection strings
- Check model service endpoints are accessible
# Follow logs in real-time
docker-compose logs -f# Follow specific service logs
docker-compose logs -f main-api# Check service configuration
docker-compose config# Check specific compose file configuration
docker-compose -f docker-compose.nomodel.yaml config- API Keys: Store sensitive API keys in environment variables or Docker secrets
- Network Security: Services communicate over internal Docker network
- Database Security: Change default PostgreSQL credentials in production
- RabbitMQ Security: Change default RabbitMQ credentials in production
- File Uploads: Configure appropriate file size limits and validation
- Port Binding: PostgreSQL and RabbitMQ are bound to localhost only for security
For production deployments, consider:
- Environment Variables: Use
.envfiles or external secret management - Resource Limits: Set appropriate CPU and memory limits
- Monitoring: Implement logging and monitoring solutions
- Backup Strategy: Regular database and volume backups
- SSL/TLS: Configure HTTPS termination at the proxy level
- Scaling: Use Docker Swarm or Kubernetes for orchestration
- Separate Services: Consider using external managed PostgreSQL and RabbitMQ
- Model Deployment: Deploy model service on dedicated GPU machines
For issues and support:
- Check the Activeloop NeoHorizon Documentation
- Review service logs for error messages
- Ensure all prerequisites are met
- Verify environment variable configuration
- Check network connectivity between services
This configuration is part of the Activeloop NeoHorizon project. Please refer to the main project license for usage terms.