I am trying to setup a docker-compose setup for my meteor app. the docker-compose is this
version: '2'
services:
web:
build: docker/web
ports:
- "3000:3000"
volumes:
- .:/home/meteor/app
container_name: newkeyz-web
links:
- mongo
environment:
- MONGO_URL=mongodb://mongo:27017/meteor
command: ["meteor","npm","start"]
mongo:
image: mongo
volumes:
- ./data:/data/db
ports:
- "27017:27017"
When the container starts it does start with the right command -
newkeyz-web | > newkeyz@1.9.5 start /home/meteor/app
newkeyz-web | > MONGO_URL=mongodb://mongo:27017/meteor meteor --settings settings.json
But the meteor app still tries to connect to the local mongodb instance
MongoError: failed to connect to server [127.0.0.1:3001]
I’ve tried all the different ways of specifying the mongo_url in the command
export MONGO_URL=mongodb://mongo:27017/meteor && meteor --settings settings.json
MONGO_URL=mongodb://mongo:27017/meteor meteor --settings settings.json
meteor --settings settings.json
I even have a ENV in the Dockerfile but no luck
ENV MONGO_URL mongodb://mongo:27017/meteor
What am i doing wrong? Any pointers would be much appreciated.