hprasath commited on
Commit
f2e4670
·
verified ·
1 Parent(s): 04a901a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -15
Dockerfile CHANGED
@@ -1,21 +1,18 @@
1
- # Use a specific version of the node image
2
- FROM node:16-alpine
3
 
4
- # Set working directory
5
- WORKDIR /code
6
 
7
- # Copy package.json and package-lock.json and install dependencies
 
 
8
  COPY package*.json ./
9
- RUN npm install --production
10
 
11
- # Copy the rest of the application files
12
- COPY . .
13
-
14
- # Expose port
15
- EXPOSE 7860
16
 
17
- # Set user to non-root
18
- USER node
19
 
20
- # Start Node.js application
21
- CMD ["node", "index.js"]
 
1
+ FROM node:16
 
2
 
3
+ # Create app directory
4
+ WORKDIR /usr/src/app
5
 
6
+ # Install app dependencies
7
+ # A wildcard is used to ensure both package.json AND package-lock.json are copied
8
+ # where available (npm@5+)
9
  COPY package*.json ./
 
10
 
11
+ RUN npm install
12
+ # If you are building your code for production
13
+ # RUN npm ci --only=production
 
 
14
 
15
+ # Bundle app source
16
+ COPY . .
17
 
18
+ CMD [ "node", "index.js" ]