Skip to content

Commit

Permalink
passed port through env as well
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesaud committed May 11, 2018
1 parent 60b4bc5 commit d5e6dc8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ services:
depends_on:
- server-database
environment:
- DATABASE_URL=server-database
- DATABASE_URL=server-database:27017

server-database:
image: mongo
Expand Down
2 changes: 1 addition & 1 deletion server/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ app.use(cors())
var mongoose = require('mongoose');

var DATABASE_URL = process.env.DATABASE_URL || 'http://localhost'
mongoose.connect(`mongodb://${DATABASE_URL}:27017/posts`);
mongoose.connect(`mongodb://${DATABASE_URL}/posts`);

var db = mongoose.connection;
db.on("error", console.error.bind(console, "connection error"));
Expand Down

0 comments on commit d5e6dc8

Please sign in to comment.