Workaround for using Docker on Mac (and maybe Windows)
resticker opened this issue · 2 comments
I managed to get the ocr-joplin-notes Docker working by directing JOPLIN_SERVER
in the docker-env file to host.docker.internal
# docker-env
JOPLIN_SERVER=http://host.docker.internal:41184
# It also works with JOPLIN_SERVER=http://gateway.docker.internal:41184 as the docs indicate
Found the solution in the Docker docs for Mac under "I want to connect from a container to a service on the host". It has an (apparently) identical wording in the Windows docs for some reason.
Unfortunately, it seems as though this method is only intended for development, and not production. But it still might be nice to note this workaround in the README
This is for development purpose and will not work in a production environment outside of Docker Desktop for Mac.
(And an identical sentence for Windows, which is odd. It should say "Docker Desktop for Mac/Windows" or something)
For a more official or production-ready solution, I'm too much of a Docker newbie to recommend anything. There is https://github.com/qoomon/docker-host, but it seems hacky. Someone here (see update at the end) tried to solve it (again, hacky). Here's a couple leads I found, but don't have time to dig into atm https://forums.docker.com/t/docker-reverse-proxy-to-a-container-with-host-networking/97458 https://stackoverflow.com/questions/24196932/how-can-i-get-the-ip-address-from-nic-in-python
Just using host.docker.internal
doesn't seem to get a bad rap, even though the docs recommend it for development only, so maybe that is good enough for this repo?
(Btw, thanks very much for making this plugin. So far, it's worked great!)
Thanks for posting this @resticker , saved me some time deploying this today using Docker for Mac Desktop.
Thank you, very helpful.
I've included the workaround in the README