I’m running my app with Docker using mLab for my Mongo ddbb. I’d like to use another container with Mongo and link this with my app but I can’t figure out how can I do this.
So far I’ve created 2 container images running well separately: one for my app and another one with a mongo instance.
In my app container I had this env var:
MONGO_URL: mongodb://127.0.0.1:27017/recipic
But I got an error saying that it couldn’t connect so I run docker inspect [mongo_container_id]
and I had a look to the JSON displayed and changed my env var with the IPAddress under NetworkSettings:
MONGO_URL: mongodb://172.17.0.3:27017/recipic
But now I get a different error (attached img):
I don’t get this running my app locally. Should I change my docker file?
FROM node:6.9
ENV METEOR_ALLOW_SUPERUSER=true
ENV ROOT_URL="http://localhost:3000"
RUN curl "https://install.meteor.com/" | sh
COPY . /usr/src/app
WORKDIR /usr/src/app
#RUN chmod -R 700 /usr/src/app/.meteor/local
RUN meteor npm install
EXPOSE 3000
CMD ["npm", "start"]
I also tried another way, linking both images with this: docker run --link mongo -P recipic
(mongo and recipic and the names of my images). Found here: GitHub - drobbins/docker-meteor-base: A base container for building containerized meteor apps.
But I get this error:
/root/.meteor/packages/meteor-tool/.1.4.2_6.yeujez++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/meteor-promise/promise_server.js:190
Similar to: Docker Error with Meteor - #4 by beingalok
Any ideas?
Thanks!