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

@@ -1,50 +1,18 @@
services:
ollama:
image: ollama/ollama:latest
container_name: monthytracker-ollama
ports:
- "11434:11434"
volumes:
- ollama_data:/root/.ollama
healthcheck:
test: ["CMD", "ollama", "list"]
interval: 15s
timeout: 10s
retries: 20
start_period: 20s
ollama-init:
image: ollama/ollama:latest
depends_on:
ollama:
condition: service_healthy
environment:
OLLAMA_HOST: http://ollama:11434
OLLAMA_MODEL: ${OLLAMA_MODEL:-qwen3.5:9b}
entrypoint: ["/bin/sh", "-c"]
command: "ollama pull ${OLLAMA_MODEL:-qwen3.5:9b}"
volumes:
- ollama_data:/root/.ollama
restart: "no"
app:
build:
context: .
container_name: monthytracker-app
depends_on:
ollama:
condition: service_healthy
ollama-init:
condition: service_completed_successfully
environment:
DATABASE_URL: file:/data/dev.db
OLLAMA_URL: http://ollama:11434/
OLLAMA_URL: ${OLLAMA_URL:-http://host.docker.internal:11434/}
OLLAMA_MODEL: ${OLLAMA_MODEL:-qwen3.5:9b}
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "3000:3000"
volumes:
- app_data:/data
volumes:
ollama_data:
app_data: