yongjhih / docker-parse-server

Provide docker images and docker stack for parse-server npm versions and latest commit
https://hub.docker.com/r/yongjhih/parse-server/
Apache License 2.0
475 stars 166 forks source link

Usage with docker-machine #6

Closed gerhardsletten closed 8 years ago

gerhardsletten commented 8 years ago

On a mac I had to specify the DATABASE_URI with ip:port to my mongodb docker to make in work:

docker run -d -p 27017:27017 --name mongo mongo
docker run -e APP_ID=secret -e DATABASE_URI=mongodb://192.168.99.100:27017/dev -e MASTER_KEY=super-secret -p 1337:1337 yongjhih/parse-server
yongjhih commented 8 years ago

I'll reproduce it on mac later. Thanks for your report.

gerhardsletten commented 8 years ago

Don't know it there is something special on my machine (OS X 10.10.5) or using docker links with docker-machine, but in order to use --link parameter, the linked docker will not be available on 172.0.0.1 so I need to find the ip-adresse like this:

...
var links = require('docker-links').parseLinks(process.env);
...
var api = new ParseServer({
  databaseURI: databaseUri || 'mongodb://' + links.mongo.hostname + ':27017/dev',
  ...
});

Should I push a pull request for it?

yongjhih commented 8 years ago

I dont not sure, but you can make it. I'll merge it if nobody has another opinion.

yongjhih commented 8 years ago

7 merged