Skip to content

Commit

Permalink
Added docker file
Browse files Browse the repository at this point in the history
  • Loading branch information
harishmarri committed Nov 28, 2020
1 parent 8bb6110 commit 0073a6b
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM node:12.18.1
ENV NODE_ENV=development

WORKDIR /app

COPY ["package.json", "package-lock.json*", "./"]

RUN npm install

COPY . .

CMD [ "node", "app.js" ]
25 changes: 25 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: '3.8'

services:
notes:
build:
context: .
ports:
- 8000:8000
environment:
- SERVER_PORT=8000
- DATABASE_CONNECTIONSTRING=mongodb://localhost:27017/snake-game
volumes:
- ./:/code
command: node app.js

mongo:
image: mongo:4.2.8
ports:
- 27017:27017
volumes:
- mongodb:/data/db
- mongodb_config:/data/configdb
volumes:
mongodb:
mongodb_config:
25 changes: 25 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: '3.3'

services:
notes:
build:
context: .
ports:
- 8000:8000
environment:
- SERVER_PORT=8000
- DATABASE_CONNECTIONSTRING=mongodb://localhost:27017/snake-game
volumes:
- ./:/code
command: node app.js

mongo:
image: mongo:4.2.8
ports:
- 27017:27017
volumes:
- mongodb:/data/db
- mongodb_config:/data/configdb
volumes:
mongodb:
mongodb_config:

0 comments on commit 0073a6b

Please sign in to comment.