docker-compose.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. # Uncomment below for WIP: Auth support
  24. # ollama-webui-db:
  25. # image: mongo
  26. # container_name: ollama-webui-db
  27. # restart: always
  28. # # Make sure to change the username/password!
  29. # environment:
  30. # MONGO_INITDB_ROOT_USERNAME: root
  31. # MONGO_INITDB_ROOT_PASSWORD: example
  32. ollama-webui:
  33. build:
  34. context: .
  35. args:
  36. OLLAMA_API_BASE_URL: '/ollama/api'
  37. dockerfile: Dockerfile
  38. image: ollama-webui:latest
  39. container_name: ollama-webui
  40. depends_on:
  41. - ollama
  42. # Uncomment below for WIP: Auth support
  43. # - ollama-webui-db
  44. ports:
  45. - 3000:8080
  46. environment:
  47. - "OLLAMA_API_BASE_URL=http://ollama:11434/api"
  48. # Uncomment below for WIP: Auth support
  49. # - "WEBUI_AUTH=TRUE"
  50. # - "WEBUI_DB_URL=mongodb://root:example@ollama-webui-db:27017/"
  51. # - "WEBUI_JWT_SECRET_KEY=SECRET_KEY"
  52. extra_hosts:
  53. - host.docker.internal:host-gateway
  54. restart: unless-stopped
  55. volumes:
  56. ollama: {}