This document describes the Docker-based setup for HelixCode, providing a complete containerized environment with all components.
The Docker setup provides:
- Complete Containerization: All HelixCode components in Docker containers
- Network Access: REST API accessible from the entire network
- Project Access: Mounted directories for workspace and projects
- Distributed Processing: Worker nodes for parallel task execution
- Easy Management: Facade script for simplified container management
- Docker and Docker Compose installed
- At least 4GB RAM available
- Git (for cloning the repository)
-
Clone the repository (if not already done):
git clone <repository-url> cd HelixCode
-
Setup environment:
cp .env.example .env # Edit .env file with your preferences -
Make the facade script executable:
chmod +x helix
-
Start the container:
./helix start
-
Access the services:
- REST API: http://localhost:8080
- Terminal UI:
./helix tui - CLI:
./helix cli --help
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ HelixCode │ │ PostgreSQL │ │ Redis │
│ Main Container│ │ Database │ │ Cache │
│ │ │ │ │ │
│ • REST API │◄──►│ • User Data │◄──►│ • Session Cache │
│ • CLI Interface │ │ • Task Data │ │ • Task Queue │
│ • Terminal UI │ │ • Project Data │ │ • Worker Comms │
│ • Worker Master │ │ • Session Data │ │ │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│
│ SSH/Worker Protocol
▼
┌─────────────────┐ ┌─────────────────┐
│ Worker Node │ │ Worker Node │
│ (CPU Focused) │ │ (GPU Focused) │
│ │ │ │
│ • Code Gen │ │ • LLM Inference │
│ • Testing │ │ • Model Training│
│ • Python Exec │ │ • Docker Exec │
└─────────────────┘ └─────────────────┘
- Internal Network:
helixcode-network(172.20.0.0/16) - Port Mapping:
- 8080: REST API (configurable via HELIX_API_PORT)
- 2222: SSH Worker Connections (configurable via HELIX_SSH_PORT)
- 3000: Web Interface (configurable via HELIX_WEB_PORT)
./workspace: Main working directory./projects: Project storage./shared: Shared configuration and discovery data./helix_code/config: Application configuration./helix_code/assets: Static assets
The helix script provides a unified interface:
# Start the container
./helix start
# Check status
./helix status
# Run CLI commands
./helix cli --list-workers
./helix cli --health
# Start Terminal UI
./helix tui
# View logs
./helix logs
./helix logs helixcode # Specific service
# Stop the container
./helix stop
# Restart
./helix restartYou can also access the container directly:
# Execute commands in the container
docker exec -it helixcode helix cli --help
# Access shell
docker exec -it helixcode /bin/bash
# View container processes
docker exec helixcode ps aux-
Mount your projects:
- Place your projects in the
./projectsdirectory - They will be accessible inside the container at
/projects
- Place your projects in the
-
Use the workspace:
- The
./workspacedirectory is your main working area - All HelixCode operations will use this directory
- The
-
Access from multiple nodes:
- In distributed mode, the shared configuration is available in
./shared - Other nodes can discover and connect automatically
- In distributed mode, the shared configuration is available in
Create a .env file in the root directory:
# Required for security
HELIX_DATABASE_PASSWORD=your-db-password
HELIX_AUTH_JWT_SECRET=your-jwt-secret
HELIX_REDIS_PASSWORD=your-redis-password
# Port configuration (adjust if ports are occupied)
HELIX_API_PORT=8080
HELIX_SSH_PORT=2222
HELIX_WEB_PORT=3000
# Network mode
HELIX_NETWORK_MODE=standalone # or 'distributed'
# Auto-port adjustment
HELIX_AUTO_PORT=false- Single container with all services
- Suitable for development and single-user scenarios
- Simple setup and management
- Multiple containers can connect and share workload
- Automatic service discovery
- Suitable for team environments and high-load scenarios
- Enable with:
HELIX_NETWORK_MODE=distributed
If ports are occupied, you can:
- Manual adjustment: Change port numbers in
.env - Auto-adjustment: Set
HELIX_AUTO_PORT=trueto automatically find available ports
Additional worker nodes can be added to the docker-compose.helix.yml:
worker-3:
build:
context: .
dockerfile: Dockerfile.worker
container_name: helixcode-worker-3
hostname: worker-3
environment:
- WORKER_ID=worker-3
- WORKER_CAPABILITIES=data-processing,analysis
- WORKER_MAX_TASKS=2
- HELIX_SERVER=helixcode:2222
volumes:
- ./helix_code/test/ssh-keys:/root/.ssh:ro
- ./workspace:/workspace:ro
- ./projects:/projects:ro
depends_on:
helixcode:
condition: service_healthy
networks:
- helixcode-networkCreate custom worker images with specific capabilities:
FROM helixcode/worker:latest
# Install additional dependencies
RUN apk add --no-cache python3 py3-pip
RUN pip3 install numpy pandas scikit-learn
# Set custom capabilities
ENV WORKER_CAPABILITIES=data-science,machine-learning,python
ENV WORKER_MAX_TASKS=3To use external PostgreSQL or Redis instead of the included ones:
# In .env file
HELIX_DATABASE_URL=postgres://user:pass@host:port/database?sslmode=disable
HELIX_REDIS_URL=redis://user:pass@host:port/database
# Then comment out postgres and redis services in docker-compose.helix.yml-
Port conflicts:
# Check what's using the ports netstat -tulpn | grep :8080 netstat -tulpn | grep :2222 netstat -tulpn | grep :3000 # Or use auto-port adjustment HELIX_AUTO_PORT=true ./helix start
-
Container not starting:
# Check logs ./helix logs # Check Docker daemon docker info # Check available resources docker system df
-
Worker connection issues:
# Check SSH keys ls -la helix_code/test/ssh-keys/ # Test worker connectivity docker exec helixcode ssh -o StrictHostKeyChecking=no worker-1 echo "test"
- Minimum: 2GB RAM, 2 CPU cores
- Recommended: 4GB RAM, 4 CPU cores
- Production: 8GB+ RAM, 8+ CPU cores
-
Increase worker resources:
deploy: resources: limits: cpus: '4.0' memory: 8G
-
Use external databases for production workloads
-
Enable distributed mode for multi-user scenarios
-
Mount SSDs for better I/O performance
- Change default passwords in
.env - Use HTTPS in production (reverse proxy recommended)
- Restrict network access to necessary ports only
- Regularly update container images
- Monitor resource usage and set limits
# Build main image
docker build -t helixcode:latest .
# Build worker image
docker build -f Dockerfile.worker -t helixcode-worker:latest .# Run tests in container
./helix exec go test ./...
# Development mode with mounted source
./helix exec bash -c "cd /app && go run cmd/server/main.go"For issues and questions:
- Check the logs:
./helix logs - Verify container status:
./helix status - Check resource usage:
docker stats - Review this documentation
This Docker setup is part of the HelixCode project. See the main project LICENSE for details.