what are the logs for ollama? docker logs ollama
to find out why it’s restarting?
you’ll probably want to link a volume to ollama as well otherwise you go through the hassle of needing to manually pull a model each time you start it up. I’ve got an example here which also has a few other bells and whistles that work for my machine (see ollama dockerhub for GPU details):
volumes:
ollama_data:
driver: local
services:
ollama:
container_name: ollama
hostname: ollama
image: ollama/ollama:0.3.9
deploy:
resources:
reservations:
devices:
- driver: nvidia
capabilities: ["gpu"]
count: all
volumes:
- ollama_data:/root/.ollama
restart: always
ports:
- 11434:11434
healthcheck:
test: ollama list || exit 1
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
Have you tried OLLAMA_URL=http://ollama:11434
for your verba services environment variables? I’ve found that I don’t need host.docker.internal if I’m running ollama as part of docker compose, only if it’s externally being fired up with something like docker run ollama