Skip to content

Commit

Permalink
Add Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
dedsecrattle committed Sep 24, 2024
1 parent a09228f commit 167990d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions backend/question-service/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
DB_CLOUD_URI="Production MongoDB URI"
DB_CLOUD_URI=<CONNECTION_STRING>
DB_LOCAL_URI="mongodb://127.0.0.1:27017/peerprepQuestionServiceDB"
PORT=3000

# Will use cloud MongoDB Atlas database
ENV=DEV
ENV=PROD
13 changes: 13 additions & 0 deletions backend/question-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:20-alpine

WORKDIR /app

COPY package*.json .

RUN npm install

COPY . .

EXPOSE 3000

CMD ["npm", "run", "start"]
3 changes: 2 additions & 1 deletion backend/question-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "nodemon ./src/server.ts"
"dev": "nodemon ./src/server.ts",
"start": "tsc && node ./dist/server.js"
},
"keywords": [],
"author": "",
Expand Down

0 comments on commit 167990d

Please sign in to comment.