adds devcontainer with docker

This commit is contained in:
2026-06-14 18:53:28 +00:00
parent 5f0d8511d2
commit b41371944d
3 changed files with 40 additions and 2 deletions
+28
View File
@@ -54,6 +54,34 @@ Each stage reads the previous stage's output file. Stages are independent and ca
- Concurrent processing with `asyncio.Semaphore(CONCURRENCY_LIMIT=1)`.
- Cleans up intermediate WAV files after conversion.
### DevContainer (`.devcontainer/`)
A VS Code Dev Container enables reproducible development. Two files define it:
- **`Dockerfile`** (based on `python:3.11-slim`):
- Installs system deps: `git`, `curl`, `ffmpeg`.
- Copies and installs `requirements.txt` (project root) into the container at `/app/`.
- Sets default env vars: `OLLAMA_URL`, `MODEL_NAME`, `PORT`, `POLL_INTERVAL`, `DATA_DIR`, `TTS_VOICE`.
- Creates `/app/data/audio/` for output.
- **`devcontainer.json`**:
- Points VS Code to the Dockerfile.
- Forwards port `8080` (newscast API).
- `postCreateCommand`: runs `pip install -r requirements.txt` in the VS Code Python interpreter for IDE features (linting, completions).
- `remoteEnv`: overrides Dockerfile defaults with workspace-relative values (e.g., `DATA_DIR` points to `${workspaceFolder}/data`).
- Extensions: `ms-python.python`, `ms-python.vscode-pylance`.
**Key env vars** (Dockerfile defaults, overridable via `devcontainer.json` `remoteEnv`):
| Variable | Default | Description |
|---|---|---|
| `OLLAMA_URL` | `http://host.docker.internal:11434/api/generate` | Ollama API endpoint (use `host.docker.internal` to reach host from container) |
| `MODEL_NAME` | `gemma4:e2b` | Ollama model identifier |
| `PORT` | `8080` | Newscast API listen port |
| `POLL_INTERVAL` | `21600` | API polling interval in seconds (6 hours) |
| `DATA_DIR` | `/app/data` | Base directory for all pipeline output files |
| `TTS_VOICE` | `af_heart` | Kokoro TTS voice |
## Common Tasks
### Add a New Pipeline Stage