version: '3.8'

networks:
  openwebui_network:
    driver: bridge

services:
  openwebui:
    image: harbor.spacemit.com/application/openwebui-image:latest
    restart: always
    container_name: openwebui
    ports:
      - "8080:8080"
    environment:
      - PYTHONPATH=/workspace/pybuild/lib
    command: >
      /bin/bash -c "
      export PYTHONPATH=/workspace/pybuild/lib &&
      source /workspace/pybuild/bin/activate &&
      bash /workspace/OpenWebUI/backend/start.sh
      "
    networks:
      - openwebui_network
    depends_on:
      - ollama

  ollama:
    image: harbor.spacemit.com/application/ollama:r1
    restart: always
    container_name: ollama
    environment:
      - OLLAMA_HOST=0.0.0.0
    command: >
      /bin/bash -c "
      taskset -c 0-3 ollama serve
      "
    networks:
      - openwebui_network

