Open digimonster opened 5 months ago
The backend (the price of code which tries to connect to ollama) runs inside a docker container.
A docker container is like a small virtual computer. This virtual computer has its own networking. Connecting to localhost from inside the container will connect to the localhost of the container, not your MacBooks localhost.
I have to find the IP of your MacBook and connect to it, not the containers localhost.
Sadly, there isn't a universal working solution for this (that I know of). MacOS and Windows run docker inside a real virtual machine, which makes it hard to set a sensible default for the Ollama connection.
Try this:
docker exec -it localsearchui-backend-dev-1 ip r
The ip in red should be your hosts ip (inside the docker network). On linux this would allow you to connect to it. Im not sure about MacOS, since containers run in vms.
I was able to solve this on MacOS by adding
extra_hosts:
- "host.docker.internal:host-gateway"
inside my docker-compose.yaml
file backend config and then setting - OLLAMA_HOST=http://host.docker.internal:11434
inside environments. This gives access for processes running inside a docker container to the host services running outside the container.
I was able to solve this on MacOS by adding
extra_hosts: - "host.docker.internal:host-gateway"
inside my
docker-compose.yaml
file backend config and then setting- OLLAMA_HOST=http://host.docker.internal:11434
inside environments. This gives access for processes running inside a docker container to the host services running outside the container.
oh, this works on macOS? i though not, because macOS is running docker inside a vm. Thanks for checking :)
FWIW, on mac I was able to add
- OLLAMA_HOST=http://host.docker.internal:11434
To get it to work.
I apologise if there is a better way to communicate this, than reopening this issue, but I got the exact same problem, cloning the master today.
After some searching, I figured out that for host.docker.internal to work on Linux (or at least my Arch Linux install), docker desktop had to be installed.
It took me quite some time to figure out, so I wanted to share, in case others have the same trouble. Maybe this could be put in the readme.md.
Thanks for your amazing work!
Docker Desktop as in the GUI application? Works on my dev machine (NixOS) and my test server (ubuntu 22.04) without it
still good to know, thanks. i think i will rework the networking thing to make it less "best practice" and more usable haha
Yes, as in the desktop application. it also needs to be started, for it to work, so it does not seem to be -only- a dependency issue, either ¯(°_o)/¯ weird
This was a test on my laptop on cpu, which was pretty useless (way too slow), so I will try to get it working on my desktop now - will let you know if I find the root cause for my trouble, and if it is consistant across my Arch devices.
I can also fire up a fresh Arch out-of-the-box VM with gnome, so we know it's not my setup or WM being difficult :)
I will let you know my findings.
I have done the same steps on my Arch desktop, as well as a fresh VM install of Arch, gnome, ollama and docker - with the same behaviour on all computers. Without docker-desktop, I get connection refused, even when setting host IP directly in docker-compose.yaml.
As this seems to be arch rooted, I see no reason for you to give this much more though, as it is working on other distros. But I will let you know, if I find a less crazy solution than installing a gig of desktop-app, haha
again, thanks for you great work - much obliged!
Yea i guess i will go with a more simplistic networking setup. People who need something more complex will build something fitting for themselves anyway
thanks for reporting
Depends on #21 tho haha, vite ignores my attempts to set values using env vars haha
I am experiencing this issue on my Fedora 39 machine as well. Here's my setup:
OS: Fedora 39
Docker Engine: 26.0.1
Docker Compose: v2.26.1
Ollama: 0.1.30
I'll continue debugging this and post my findings here if I discover a solution.
Thanks for all the hard work; this project is amazing!
Hi, I followed the tutorial to start this project locally, but I'm unable to access the local ollama service. I want to know how to resolve this issue. Here is my error message:
My local env:
os:MacBook Pro M1 Pro 14.2.1 ollama version is 0.1.29 python: 3.11
docker-compose.dev.yaml
Error Info:
ollama pull api test