softwareshinobi
softwareshinobi lifestyles of the rich and famous.

Ollama Docker Compose

Ollama Docker Compose
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
services:
  ollama:
    image: ollama/ollama:latest
    container_name: ollama
    restart: unless-stopped
    volumes:
      - ./ollama/ollama:/root/.ollama
    environment:
      - OLLAMA_KEEP_ALIVE=24h

  ollama-webui:
    image: ghcr.io/open-webui/open-webui:main
    container_name: ollama-webui
    restart: unless-stopped
    ports:
      - "8080:8080"
    volumes:
      - ./ollama/ollama-webui:/app/backend/data
    environment:
      - OLLAMA_BASE_URL=http://ollama:11434
      - WEBUI_AUTH=False
    depends_on:
      - ollama

Pulling and Managing Models

Pull the Llama 3.2 model:

1
2
docker exec -it ollama ollama pull llama3.2

Pull the Qwen 3 model:

1
2
docker exec -it ollama ollama pull qwen3:0.6b

Run the model interactively:

1
2
docker exec -it ollama ollama run qwen3:0.6b

List installed models:

1
2
docker exec -it ollama ollama list

Exit the interactive chat:

1
2
/bye

Delete heavier models to free up resources:

1
2
docker exec -it ollama ollama rm llama3.2