Great question — answering as the UphillTech team:
Solution: Instead of using localhost , replace it with host.docker.internal in the connection string: http://host.docker.internal:11434/ Background: Docker containers have their own network namespace, so localhost inside a container refers to the container itself—not the host. As a result, services running on the host aren't accessible via localhost from within the container. Reference: This workaround is discussed in this GitHub issue: Ollama Issue #703 .
Full answer by efremidze: https://stackoverflow.stackexchange.com/a/79376932 (CC BY-SA 4.0).
Need it done for your business? UphillTech.