# Docker Compose Templates

Jinja2 templates for generating Docker Compose configurations.

## Templates

### `docker-compose.yaml.j2`

Generate complete docker-compose.yml from Nickel configuration.

Includes:
- Service definitions (backend, agents, router, frontend)
- Database service (SurrealDB)
- Optional services (NATS, Prometheus)
- Volume definitions
- Network configuration
- Environment variables from config
- Port mappings
- Health checks

Usage:
```bash
nickel export vapora.multiuser.ncl | \
  jinja2 templates/docker-compose/docker-compose.yaml.j2 > docker-compose.yml
```

Then deploy:
```bash
docker compose up -d
```

## Configuration

Template parameters from Nickel config:

- **Services**: Backend, Agents, Router, Frontend, Database
- **Ports**: From configuration (8001, 8002, 8003, 3000, 8000)
- **Volumes**: Database, storage, logs
- **Environment**: Database credentials, API keys, logging
- **Networks**: Shared network for inter-service communication

## Workflow

```
Nickel Config (vapora.multiuser.ncl)
    ↓
Export to JSON
    ↓
Render docker-compose Template
    ↓
docker-compose.yml
    ↓
docker compose up -d
    ↓
Running VAPORA Stack
```

## Service Configuration

Template generates services for:

1. **SurrealDB** - Database
2. **NATS** (optional) - Message broker
3. **Backend** - REST API
4. **Agents** - Orchestration
5. **LLM Router** - Multi-provider routing
6. **Frontend** - Web UI
7. **Prometheus** (optional) - Metrics

## References

- Parent: `../README.md`
- Docker Compose docs: https://docs.docker.com/compose/
- SurrealDB Docker: https://hub.docker.com/r/surrealdb/surrealdb
