File size: 702 Bytes
fe427e7
 
8327612
fe427e7
 
 
 
 
80e82c8
8327612
fe427e7
8327612
 
 
 
80e82c8
8327612
 
 
 
 
00985f1
8327612
80e82c8
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Use the Node.js base image.
FROM node:20-slim

# Install system dependencies.
# The --no-install-recommends flag prevents a lot of unnecessary packages from being installed, which can cause issues.
RUN apt-get update && apt-get install -y --no-install-recommends libheif-dev libavif-dev libheif-examples

# Set the working directory.
WORKDIR /usr/src/app

# Copy the dependency files.
COPY package*.json ./

# Install Node.js dependencies.
RUN npm install
RUN npm install -g pm2

# Copy the rest of the application files.
COPY . .

# Expose the port your app runs on.
EXPOSE 7860

# Command to run the application using PM2 to spin up 4 workers.
CMD [ "pm2-runtime", "start", "server.js", "-i", "4" ]