compose.yaml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. version: '3.6'
  2. services:
  3. ollama:
  4. # Uncomment below for GPU support
  5. # deploy:
  6. # resources:
  7. # reservations:
  8. # devices:
  9. # - driver: nvidia
  10. # count: 1
  11. # capabilities:
  12. # - gpu
  13. volumes:
  14. - ollama:/root/.ollama
  15. # Uncomment below to expose Ollama API outside the container stack
  16. # ports:
  17. # - 11434:11434
  18. container_name: ollama
  19. pull_policy: always
  20. tty: true
  21. restart: unless-stopped
  22. image: ollama/ollama:latest
  23. ollama-webui-db:
  24. image: mongo
  25. container_name: ollama-webui-db
  26. restart: always
  27. # Make sure to change the username/password!
  28. environment:
  29. MONGO_INITDB_ROOT_USERNAME: root
  30. MONGO_INITDB_ROOT_PASSWORD: example
  31. ollama-webui:
  32. build:
  33. context: .
  34. args:
  35. OLLAMA_API_BASE_URL: '/ollama/api'
  36. dockerfile: Dockerfile
  37. image: ollama-webui:latest
  38. container_name: ollama-webui
  39. depends_on:
  40. - ollama
  41. - ollama-webui-db
  42. ports:
  43. - 3000:8080
  44. environment:
  45. - "OLLAMA_API_BASE_URL=http://ollama:11434/api"
  46. - "WEBUI_AUTH=TRUE"
  47. - "WEBUI_DB_URL=mongodb://root:example@ollama-webui-db:27017/"
  48. - "WEBUI_JWT_SECRET_KEY=SECRET_KEY"
  49. extra_hosts:
  50. - host.docker.internal:host-gateway
  51. restart: unless-stopped
  52. volumes:
  53. ollama: {}