ilhamdev commited on
Commit
a8c5bee
·
verified ·
1 Parent(s): 195a3e3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -28
Dockerfile CHANGED
@@ -1,25 +1,7 @@
1
- # Stage 1: Build Stage
2
- FROM node:18-alpine AS build
3
 
4
- # Set environment variables for Node.js
5
- ENV NODE_ENV=production
6
-
7
- # Set working directory
8
  WORKDIR /app
9
 
10
- # Copy package.json and package-lock.json
11
- COPY package*.json ./
12
-
13
- # Install production dependencies
14
- RUN npm install --only=production
15
-
16
- # Copy the entire application
17
- COPY . .
18
-
19
- # Remove any development dependencies to keep the build clean
20
- RUN npm prune --production
21
-
22
- # Install required system packages
23
  RUN apk add --no-cache \
24
  git \
25
  python3 \
@@ -30,17 +12,12 @@ RUN apk add --no-cache \
30
  ttf-freefont \
31
  ffmpeg
32
 
33
- # Clean up package cache to keep image size small
34
- RUN rm -rf /var/cache/apk/*
35
 
36
- # Set the working directory
37
- WORKDIR /app
38
 
39
- # Copy only the necessary files from the build stage
40
- COPY --from=build /app .
41
 
42
- # Expose the port the app runs on
43
  EXPOSE 7860
44
 
45
- # Command to run the application
46
- CMD ["node", "index.js"]
 
1
+ FROM node:latest
 
2
 
 
 
 
 
3
  WORKDIR /app
4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  RUN apk add --no-cache \
6
  git \
7
  python3 \
 
12
  ttf-freefont \
13
  ffmpeg
14
 
15
+ COPY package*.json ./
 
16
 
17
+ RUN npm install
 
18
 
19
+ COPY . .
 
20
 
 
21
  EXPOSE 7860
22
 
23
+ CMD ["node", "index.js"]