Multi-Instance Docker Setup¶
Overview¶
This guide explains how to run multiple instances of Huntable CTI Studio simultaneously without port conflicts.
Port Allocation¶
| Service | Original Port | Dev2 Port | Container Name |
|---|---|---|---|
| Web App | 8001 | 8002 | cti_web_dev2 |
| PostgreSQL | 5432 | 5433 | cti_postgres_dev2 |
| Redis | 6379 | 6380 | cti_redis_dev2 |
Setup Instructions¶
1. Clone Repository¶
git clone /path/to/Huntable-CTI-Studio /path/to/Huntable-CTI-Studio-dev2
cd /path/to/Huntable-CTI-Studio-dev2
2. Provision Secrets and Config¶
See Development Setup for whatsetup.sh does.
3. Start Dev2 Instance¶
Dev2 service boundary
Dev2 uses the same ./init-scripts/ directory as the primary stack, so a fresh Dev2
Postgres instance receives the standard initialization scripts. Dev2 is intentionally limited
to postgres, redis, web, worker, scheduler, and cli: workflow_worker,
maintenance, mcp_http, and codex_auth_init are out of scope. Agentic workflow
execution, backup/restore, and MCP HTTP access therefore require the primary stack.
4. Verify Services¶
# Check web app
curl http://localhost:8002/health
# Check database
docker exec -it cti_postgres_dev2 psql -U cti_user -d cti_scraper -c "SELECT version();"
# Check Redis
docker exec -it cti_redis_dev2 redis-cli -a ${REDIS_PASSWORD} ping
Database Management¶
Access Dev2 Database¶
Backup Dev2 Database¶
Restore to Dev2 Database¶
CLI Commands¶
Run CLI in Dev2 Instance¶
Example: Rescore Articles¶
Stopping Instances¶
Stop Dev2 Instance¶
Stop All Instances¶
# Original instance
docker-compose down
# Dev2 instance
docker-compose -f docker-compose.dev2.yml down
Volume Management¶
Each instance uses separate Docker volumes:
- postgres_data_dev2
- redis_data_dev2
This ensures complete data isolation between instances.
Network Isolation¶
Each instance uses its own Docker network (cti_network_dev2) to prevent service conflicts.
Troubleshooting¶
Port Already in Use¶
If you encounter port conflicts, check what's using the ports:
Local LLM endpoints are host-managed and are not part of the Dev2 Compose port map.
Container Name Conflicts¶
All Dev2 containers use _dev2 suffix to avoid naming conflicts with the original instance.
Last updated: 2026-07-03 Last reviewed: 2026-09-01