Skip to content

Commit 92e77a0

Browse files
author
Erwan
committed
docker-compose mongose + meterial
1 parent 27678bc commit 92e77a0

File tree

9 files changed

+957
-63
lines changed

9 files changed

+957
-63
lines changed

app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ mongoose.set('debug', function (collectionName, method, query, doc) {
4141
var timeout = 3000000;
4242

4343
mongoose.connect(
44-
'mongodb+srv://formationNodeUser:formationNodePassword@cluster0-kt0tr.mongodb.net/test?retryWrites=true&w=majority',
44+
'mongodb://mongodb:27017/formation-node',
4545
{
4646
promiseLibrary: global.Promise,
4747
useNewUrlParser: true

bin/www

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var socket = require('./../socket');
1313
* Get port from environment and store in Express.
1414
*/
1515

16-
var port = normalizePort(process.env.PORT || '3000');
16+
var port = normalizePort(process.env.PORT || '8080');
1717
app.set('port', port);
1818

1919
/**

docker-compose.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,32 @@ version: '3'
22

33
services:
44

5+
mongodb:
6+
image: mongo:latest
7+
ports:
8+
- 27017:27017
9+
volumes:
10+
- mongodb_data_container:/data/db
11+
12+
mongodbclient:
13+
image: mongoclient/mongoclient
14+
ports:
15+
- 3000:3000
16+
517
node:
6-
image: thecodingmachine/nodejs:10
18+
image: thecodingmachine/nodejs:14
719
volumes:
820
- ./:/usr/src/app
921
environment:
1022
STARTUP_COMMAND_1: npm install
11-
STARTUP_COMMAND_2: npm start
23+
STARTUP_COMMAND_2: nodemon ./bin/www
24+
depends_on:
25+
- mongodb
26+
links:
27+
- mongodb
1228
ports:
13-
- "3000:3000"
29+
- 8080:8080
30+
31+
volumes:
32+
mongodb_data_container:
33+

0 commit comments

Comments
 (0)