Skip to content

Commit b804357

Browse files
author
Rishabh Garg
committed
Added Docker File
1 parent 3d5d3d5 commit b804357

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Specify bas image
2+
FROM node:alpine
3+
4+
WORKDIR /usr/app
5+
6+
# Install Dependency
7+
COPY ./package.json ./
8+
RUN npm install
9+
COPY ./ ./
10+
RUN npm run build
11+
12+
# Run command
13+
CMD ["npm", "run", "prod"]

Dockerfile.dev

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Specify bas image
2+
FROM node:alpine
3+
4+
WORKDIR /usr/app
5+
6+
# Install Dependency
7+
COPY ./package.json ./
8+
RUN npm install
9+
COPY ./ ./
10+
11+
# Run command
12+
CMD ["npm", "start"]

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Node Js basic structure using typescript and able to host with serverless",
55
"main": "index.js",
66
"scripts": {
7-
"tsc": "tsc",
7+
"build": "tsc",
88
"dev": "ts-node-dev --respawn --transpileOnly ./server.ts",
99
"prod": "tsc && node ./build/server.js"
1010
},

0 commit comments

Comments
 (0)