# Deployment

Vaani 0.1 is a single process: a local web desk, a job queue, and the files for one machine. It has no accounts. Publish it only to localhost, or to a private network you control, until sign-in exists.

## Local module

This is the first launch.

1. Install FFmpeg and make sure a new terminal can run `ffmpeg -version`.
2. Install Python 3.11, 3.12, or 3.13. Python 3.14 is not the one `run.ps1` prefers, because the speech engine may not have a build for it.
3. Run `powershell -ExecutionPolicy Bypass -File .\run.ps1`
4. Open http://127.0.0.1:8765

The process binds to `127.0.0.1` and port `8765` unless `.env` says otherwise. Copy `.env.example` to `.env` to change the port, the length limit, retention, or the speech model.

Source needed to run: `app/`, `static/`, `requirements.txt`, and `config/launch-gates.example.json`. The desk creates `data/` and `config/launch-gates.json` on first start.

## Docker module

The image is Python 3.11 with FFmpeg. Build it from this folder.

```powershell
copy config\launch-gates.example.json config\launch-gates.json
docker compose up --build
```

Copy the launch file before the first `up`. If that file is missing, Docker creates a folder at the mount path and the desk cannot read it.

Compose publishes `127.0.0.1:8765` only. Inside the container the process listens on `0.0.0.0` so Docker can forward the port. Recordings and the downloaded speech model stay in the `data` volume.

To change limits, edit `.env` and add it to `docker-compose.yml`:

```yaml
env_file:
  - .env
```

Set `VAANI_PRODUCTION=1` only after every item in `docs/LAUNCH-GATES.md` is confirmed. Until then the health page loads and every other API call answers 503.

## What production must have

- FFmpeg on the machine or in the image
- `VAANI_WHISPER_MODEL=medium` or `large-v3`
- `config/launch-gates.json` confirmed, and kept outside image rebuilds (the compose file mounts it)
- `data/` on a disk with the free-space floor, default 2 GB
- A bind address that is not the public internet
- A restart policy or a Windows scheduled task that runs `.\.venv\Scripts\python.exe -m app` from this folder

On Windows without Docker, a scheduled task at logon is enough for a single shared machine on a private network. The task should start in this folder, set `PYTHONIOENCODING=utf-8`, and use the virtualenv Python.

## Check that it is up

```powershell
curl http://127.0.0.1:8765/api/health
```

`ffmpeg`, `whisper`, and `ytdlp` should be true. `gates_open` stays false until the launch file is confirmed. `production` should be false for this first launch.
