> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spn.wtf/llms.txt
> Use this file to discover all available pages before exploring further.

# Deployment

> Docker Compose and EC2 deployment notes for running the services in production.

## Docker Compose Services

`docker-compose.yml` defines:

| Service        | Command                                                                      |
| -------------- | ---------------------------------------------------------------------------- |
| `db`           | PostgreSQL 16                                                                |
| `agent`        | `${AGENT_START_CMD:-python agent_realtime.py start}`                         |
| `lead_fetcher` | `python lead_fetcher.py`                                                     |
| `scheduler`    | `python scheduler.py`                                                        |
| `dashboard`    | `streamlit run streamlit_app.py --server.port 8501 --server.address 0.0.0.0` |
| `web`          | `python token_server.py`                                                     |

## Start

```powershell theme={null}
docker compose up --build
```

## Database URL In Docker

Use the Compose service hostname:

```env theme={null}
DATABASE_URL=postgresql://ignitech:ignitech@db:5432/ignitech
```

## Choosing Agent Mode

Default Compose command starts OpenAI Realtime:

```env theme={null}
AGENT_START_CMD=python agent_realtime.py start
```

For Sarvam:

```env theme={null}
AGENT_START_CMD=python agent.py start
```

## Dashboard Port

The dashboard is bound to localhost:

```text theme={null}
127.0.0.1:8502 -> container 8501
```

This keeps it private by default. Put a reverse proxy or tunnel in front of it if external access is needed.

## EC2

The repository includes:

* `deploy_ec2.sh`
* `EC2_DEPLOY.md`

Recommended production steps:

1. Provision an EC2 instance with Docker and Docker Compose.
2. Clone the repository.
3. Create `.env` with production secrets.
4. Confirm security-group inbound rules for dashboard/webhook access as needed.
5. Run `docker compose up --build -d`.
6. Check logs with `docker compose logs -f`.
7. Verify `python sip_setup.py list` against the same LiveKit project before live calling.

## Production Checklist

* `.env` contains real LiveKit, Vobiz, database, and model credentials.
* `LIVEKIT_SIP_TRUNK_ID` is the outbound trunk ID.
* `CALL_WHITELIST_NUMBERS` is empty only when live calling is intended.
* `CALL_ALLOWED_WEEKDAYS`, `CALL_HOURS_START`, and `CALL_HOURS_END` match calling policy.
* `MAX_CONCURRENT_CALLS` is set to an approved value.
* Dashboard is protected by network rules or auth controls.
* Facebook webhook URL is public and uses HTTPS in production.
* Database volume backups are configured.
* Logs do not expose API keys or sensitive qualification data.
