File tree Expand file tree Collapse file tree 5 files changed +51
-2
lines changed Expand file tree Collapse file tree 5 files changed +51
-2
lines changed Original file line number Diff line number Diff line change 44### Improvements
55
66- Move sources to ` src ` folder
7+ - Dockerize project (unstable) - See issue #6
78
89## [ 0.0.4] 2021-07-04
910### Improvements
Original file line number Diff line number Diff line change 1+ FROM node:alpine
2+
3+ RUN mkdir -p /usr/src/api-server-nodejs && chown -R node:node /usr/src/api-server-nodejs
4+
5+ WORKDIR /usr/src/api-server-nodejs
6+
7+ COPY package.json src .env ./
8+
9+ USER node
10+
11+ RUN npm i
12+
13+ COPY --chown=node:node . .
14+
15+ EXPOSE 5000
16+ CMD ["npm" , "start" ]
Original file line number Diff line number Diff line change 1+ version : ' 3'
2+
3+ services :
4+ api-server-nodejs :
5+ build : .
6+ image : api-server-nodejs
7+ environment :
8+ - MONGODB_URL=mongodb://localhost:27017/api_server_nodejs
9+ ports :
10+ - ' 5000:5000'
11+ depends_on :
12+ - mongodb
13+ volumes :
14+ - .:/usr/src/api-server-nodejs
15+ networks :
16+ - node-network
17+
18+ mongodb :
19+ image : mongo:4.2.1-bionic
20+ ports :
21+ - ' 27017:27017'
22+ volumes :
23+ - dbdata:/data/db
24+ networks :
25+ - node-network
26+
27+ volumes :
28+ dbdata :
29+
30+ networks :
31+ node-network :
32+ driver : bridge
Original file line number Diff line number Diff line change @@ -51,6 +51,6 @@ const PORT = process.env.PORT;
5151http . createServer ( {
5252} , app )
5353 . listen ( PORT , function ( ) {
54- console . log ( 'App listening on port ' + PORT + '! Go to http://localhost:' + PORT + '/' ) ;
54+ console . log ( 'API Server is listening on port ' + PORT ) ;
5555 } ) ;
5656
Original file line number Diff line number Diff line change 44Copyright (c) 2019 - present AppSeed.us
55
66*/
7- dbPasswordDev = 'mongodb://localhost/api_server_nodejs' ;
7+ dbPasswordDev = 'mongodb://localhost:27017 /api_server_nodejs' ;
88
99module . exports = {
1010 mongoURI : dbPasswordDev ,
You can’t perform that action at this time.
0 commit comments