Skip to content

Commit

Permalink
devops changes for deployment (#13)
Browse files Browse the repository at this point in the history
* chore:changed build file name

* chore: added new deps

* feat: add docker image for server along with dockerignore

---------

Co-authored-by: shazm12 <[email protected]>
  • Loading branch information
Yash7824 and shazm12 committed Aug 24, 2024
1 parent ea81344 commit d9ee4f0
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 35 deletions.
3 changes: 3 additions & 0 deletions server/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
dist
README.md
11 changes: 11 additions & 0 deletions server/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#Build stage
FROM node:20.10.0-alpine3.19

WORKDIR app/
COPY . .
RUN npm install \
&& npm run build \
&& rm -rf node_modules \
&& npm install --production

CMD ["node","dist/index.js"]
43 changes: 12 additions & 31 deletions server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "index.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "rimraf ./build && tsc",
"build": "rimraf ./dist && tsc",
"start": "nodemon index.ts"
},
"keywords": [],
Expand All @@ -14,11 +14,12 @@
"dependencies": {
"bcrypt": "^5.1.1",
"config": "^3.3.11",
"dotenv": "^16.4.5",
"cors": "^2.8.5",
"express": "^4.19.1",
"express-validator": "^7.0.1",
"jsonwebtoken": "^9.0.2",
"mongoose": "^8.2.4"
"mongoose": "^8.2.4",
"socket.io": "^4.7.5"
},
"devDependencies": {
"@types/bcrypt": "^5.0.2",
Expand All @@ -28,6 +29,7 @@
"@types/node": "^20.11.30",
"@types/socket.io": "^3.0.2",
"nodemon": "^3.1.0",
"dotenv": "^16.4.5",
"rimraf": "^5.0.5",
"ts-node": "^10.9.2",
"ts-node-dev": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion server/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"module": "commonjs",
"lib": ["es6"],
"allowJs": true,
"outDir": "build",
"outDir": "dist",
"rootDir": "",
"strict": true,
"noImplicitAny": true,
Expand Down

0 comments on commit d9ee4f0

Please sign in to comment.