Open ghost opened 8 years ago
:+1:
:+1:
Wondering how to circumvent this aswell (besides the post by OP)?
Localhost is not going to work in a container. Every container thinks it's a separate server.
Have you tried using Docker Compose as mentioned in the readme?
https://github.com/meteorhacks/meteord#22-with-docker-compose
# docker-compose.yml
dashboard:
image: yourrepo/yourapp
ports:
- "80:80"
links:
- mongo
environment:
- MONGO_URL=mongodb://mongo:27017/yourapp # "mongo:27017" resolves to the internal IP of the container below
- ROOT_URL=http://yourapp.com
- MAIL_URL=smtp://some.mailserver.com:25
mongo:
image: mongo:latest
docker-compose.yml links... https://docs.docker.com/compose/compose-file/#links
My mongodb is running inside an own container (tutum/mongodb) When I try to connect to it via localhost from meteorD connection fails
However, when define the absolute url: mongodb://my-domain.com:27017 it works. After researching I came across this issue. The answer was to use
docker run --net="host" ...
But, when I do this, I get an other error: EADDRINUSE because of port 80, which is reserved for the proxy. So I guess it's not good to share the host network, right.
So finally best practice would be to use the global mongodb uri?