Add Docker deployment support
This commit is contained in:
@@ -63,6 +63,56 @@ pip install -r requirements.txt
|
||||
python server.py
|
||||
```
|
||||
|
||||
## Docker
|
||||
|
||||
The repository now includes a container setup for running the API in Docker.
|
||||
|
||||
### What gets mounted
|
||||
|
||||
- `./config.docker.json` -> `/app/config.docker.json`
|
||||
- `./logs` -> `/app/logs`
|
||||
- `./history` -> `/app/history`
|
||||
- `./models` -> `/models`
|
||||
|
||||
Place your Whisper model inside `./models/whisper` or update `model_path` in `config.docker.json`.
|
||||
|
||||
### Build and run with Docker Compose
|
||||
|
||||
```bash
|
||||
docker compose up --build
|
||||
```
|
||||
|
||||
The API will be available at:
|
||||
|
||||
```text
|
||||
http://localhost:5042
|
||||
```
|
||||
|
||||
### Build and run with plain Docker
|
||||
|
||||
```bash
|
||||
docker build -t whisper-api-server .
|
||||
docker run --rm -p 5042:5042 \
|
||||
-v "$(pwd)/config.docker.json:/app/config.docker.json:ro" \
|
||||
-v "$(pwd)/logs:/app/logs" \
|
||||
-v "$(pwd)/history:/app/history" \
|
||||
-v "$(pwd)/models:/models" \
|
||||
whisper-api-server
|
||||
```
|
||||
|
||||
### GPU note
|
||||
|
||||
The container image installs the same Python dependencies as the local setup, including CUDA-oriented PyTorch wheels on Linux x86_64. To actually use NVIDIA GPU acceleration at runtime, start the container with GPU access enabled in your Docker environment, for example:
|
||||
|
||||
```bash
|
||||
docker run --rm --gpus all -p 5042:5042 \
|
||||
-v "$(pwd)/config.docker.json:/app/config.docker.json:ro" \
|
||||
-v "$(pwd)/logs:/app/logs" \
|
||||
-v "$(pwd)/history:/app/history" \
|
||||
-v "$(pwd)/models:/models" \
|
||||
whisper-api-server
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
The service is configured through the `config.json` file:
|
||||
|
||||
Reference in New Issue
Block a user