# Ollama + Open WebUI: stack recipe from https://archestack.com/stacks/ollama-open-webui/
# Started and checked 2026-11-19 on ubuntu-lan (x86-64, CPU only, Docker 29.9.2, Compose v5.6.1). Images are pinned: bump them on purpose.
services:
  ollama:
    image: ollama/ollama:0.40.16
    restart: unless-stopped
    volumes:
      - ollama:/root/.ollama
    healthcheck:
      test: ["CMD", "ollama", "list"]
      interval: 10s
      retries: 12
  open-webui:
    image: ghcr.io/open-webui/open-webui:v0.13.4
    restart: unless-stopped
    depends_on:
      ollama:
        condition: service_healthy
    ports:
      - "127.0.0.1:3000:8080"
    environment:
      OLLAMA_BASE_URL: http://ollama:11434
      WEBUI_SECRET_KEY: ${WEBUI_SECRET_KEY:?run the .env line first}
    volumes:
      - open-webui:/app/backend/data
volumes:
  ollama:
  open-webui:
