Rajhuggingface4253 commited on
Commit
80e82c8
·
verified ·
1 Parent(s): 6553147

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -3
Dockerfile CHANGED
@@ -6,13 +6,14 @@ FROM node:20-slim
6
  RUN apt-get update && apt-get install -y --no-install-recommends libheif-dev libavif-dev libheif-examples
7
 
8
  # Set the working directory.
9
- WORKDIR /app
10
 
11
  # Copy the dependency files.
12
  COPY package*.json ./
13
 
14
  # Install Node.js dependencies.
15
  RUN npm install
 
16
 
17
  # Copy the rest of the application files.
18
  COPY . .
@@ -20,5 +21,5 @@ COPY . .
20
  # Expose the port your app runs on.
21
  EXPOSE 7860
22
 
23
- # Command to run the application.
24
- CMD [ "node", "server.js" ]
 
6
  RUN apt-get update && apt-get install -y --no-install-recommends libheif-dev libavif-dev libheif-examples
7
 
8
  # Set the working directory.
9
+ WORKDIR /usr/src/app
10
 
11
  # Copy the dependency files.
12
  COPY package*.json ./
13
 
14
  # Install Node.js dependencies.
15
  RUN npm install
16
+ RUN npm install -g pm2
17
 
18
  # Copy the rest of the application files.
19
  COPY . .
 
21
  # Expose the port your app runs on.
22
  EXPOSE 7860
23
 
24
+ # Command to run the application using PM2 to spin up 4 workers.
25
+ CMD [ "pm2-runtime", "start", "server.js", "-i", "4" ]