DeeCeeXxx commited on
Commit
b5f45c9
·
verified ·
1 Parent(s): a9f810a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -14
Dockerfile CHANGED
@@ -1,22 +1,20 @@
1
- FROM node:lts-buster
 
2
 
3
- RUN apt-get update && \
4
- apt-get install -y \
5
- ffmpeg \
6
- imagemagick \
7
- webp && \
8
- apt-get upgrade -y && \
9
- npm i pm2 -g && \
10
- rm -rf /var/lib/apt/lists/*
11
-
12
- COPY package.json .
13
 
 
 
14
 
15
- RUN npm install pm2 -g
16
- RUN npm install --legacy-peer-deps
17
 
 
18
  COPY . .
19
 
 
20
  EXPOSE 3000
21
 
22
- CMD ["node","index.js" ]
 
 
1
+ # Use an official Node.js runtime as a parent image
2
+ FROM node:18-alpine
3
 
4
+ # Set the working directory
5
+ WORKDIR /app
 
 
 
 
 
 
 
 
6
 
7
+ # Copy package.json before installing dependencies
8
+ COPY package.json ./
9
 
10
+ # Install dependencies (ignoring package-lock.json if missing)
11
+ RUN npm install --omit=dev
12
 
13
+ # Copy the rest of the application
14
  COPY . .
15
 
16
+ # Expose the port (ensure your app listens on this)
17
  EXPOSE 3000
18
 
19
+ # Start the application
20
+ CMD ["node", "index.js"]