Add compose-based backend runtime on python 3.14
This commit is contained in:
12
README.md
12
README.md
@@ -9,8 +9,17 @@ Two separate Python packages live here:
|
||||
|
||||
The repo also includes a Gitea Actions workflow at `.gitea/workflows/ci.yml` that tests and builds both packages on pushes to `main` and pull requests.
|
||||
|
||||
## Backend setup
|
||||
## Docker backend (no image build)
|
||||
|
||||
Run the backend directly from an official Python image without creating a Dockerfile:
|
||||
|
||||
```bash
|
||||
docker compose up backend
|
||||
```
|
||||
|
||||
This uses `python:3.14-slim`, installs `ffmpeg` and `openai-whisper` at container startup, mounts this repo into the container, and serves the API on `http://localhost:8000`.
|
||||
|
||||
## Backend setup
|
||||
```bash
|
||||
cd backend
|
||||
pip install -e .
|
||||
@@ -50,3 +59,4 @@ whisper-remote ./audio.mp3 --model base --language en --output-format txt
|
||||
- backend-side cleanup of uploaded and generated files after each request
|
||||
|
||||
By default the CLI prints the returned transcript to stdout. Use `--to-file` to save it locally.
|
||||
|
||||
|
||||
22
docker-compose.yml
Normal file
22
docker-compose.yml
Normal file
@@ -0,0 +1,22 @@
|
||||
services:
|
||||
backend:
|
||||
image: python:3.14-slim
|
||||
working_dir: /app/backend
|
||||
ports:
|
||||
- "8000:8000"
|
||||
volumes:
|
||||
- ./:/app
|
||||
- whisper_cache:/root/.cache
|
||||
environment:
|
||||
- PYTHONUNBUFFERED=1
|
||||
command: >-
|
||||
sh -lc "
|
||||
apt-get update
|
||||
&& apt-get install -y --no-install-recommends ffmpeg
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
&& pip install --no-cache-dir -e . openai-whisper
|
||||
&& uvicorn server:app --app-dir src --host 0.0.0.0 --port 8000
|
||||
"
|
||||
|
||||
volumes:
|
||||
whisper_cache:
|
||||
Reference in New Issue
Block a user