Use host Ollama for Docker app runtime

This commit is contained in:
2026-03-23 14:34:07 -04:00
parent 28c5ad959f
commit 5a6d03f5c8
2 changed files with 21 additions and 41 deletions

View File

@@ -32,17 +32,29 @@ ollama pull qwen3.5:9b
## Docker Compose
Start both the app and `Ollama` together:
Run the app in Docker while keeping `Ollama` on the host:
```bash
docker compose up --build
```
This compose stack will:
- start `Ollama`
- pull `qwen3.5:9b` through the `ollama-init` service
- start the Next.js app on `http://localhost:3000`
- persist the SQLite database and pulled model with named Docker volumes
- start only the Next.js app on `http://localhost:3000`
- keep SQLite data in a named Docker volume
- connect to host `Ollama` through `host.docker.internal`
Before running Docker Compose, make sure host `Ollama` is already up:
```bash
ollama serve
ollama pull qwen3.5:9b
```
If you run the app outside Docker, keep using:
```bash
OLLAMA_URL=http://127.0.0.1:11434/
```
## In-app helpers
@@ -53,5 +65,5 @@ This compose stack will:
## Environment
- `DATABASE_URL` - Prisma SQLite connection string
- `OLLAMA_URL` - local or container Ollama base URL
- `OLLAMA_URL` - Ollama base URL; in Docker Compose this defaults to `http://host.docker.internal:11434/`
- `OLLAMA_MODEL` - selected model tag, default `qwen3.5:9b`