mikmc commited on
Commit
a6c6c96
·
verified ·
1 Parent(s): 736edd5

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -7
Dockerfile CHANGED
@@ -1,15 +1,20 @@
1
- FROM node:18.16.0-alpine as base
 
2
 
3
- WORKDIR /app
 
4
 
 
5
  COPY package*.json ./
6
 
7
- RUN npm install
 
8
 
 
9
  COPY . .
10
 
11
- ENV NODE_ENV production
 
12
 
13
- EXPOSE 3649
14
-
15
- CMD [ "node", "index.js" ]
 
1
+ # Use the official Node.js 18 base image
2
+ FROM node:18-slim
3
 
4
+ # Set the working directory inside the container
5
+ WORKDIR /usr/src/app
6
 
7
+ # Copy the package.json and package-lock.json if available
8
  COPY package*.json ./
9
 
10
+ # Install the app dependencies
11
+ RUN npm install --production
12
 
13
+ # Copy the rest of the application code to the container
14
  COPY . .
15
 
16
+ # Expose the port your app will run on
17
+ EXPOSE 3000
18
 
19
+ # Command to start the app
20
+ CMD ["npm", "start"]