Donyking1818 commited on
Commit
f60fc14
·
verified ·
1 Parent(s): cb00eaf

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -9
Dockerfile CHANGED
@@ -1,20 +1,21 @@
1
- FROM node:18
 
2
 
3
- # Install dependencies
4
- RUN apt-get update && apt-get install -y git curl && rm -rf /var/lib/apt/lists/*
5
 
6
  WORKDIR /app
7
 
8
  # Copy dan install
9
  COPY package.json ./
10
- RUN npm install
11
 
12
  COPY . .
13
 
14
- # Expose port 7860 (wajib buat Hugging Face)
15
- EXPOSE 7860
16
-
17
  ENV PORT=7860
18
- ENV NODE_ENV=production
19
 
20
- CMD ["node", "index.js"]
 
 
 
1
+ # Pake Alpine (lebih kecil dari node:18)
2
+ FROM node:18-alpine
3
 
4
+ # Install git saja (minimum)
5
+ RUN apk add --no-cache git
6
 
7
  WORKDIR /app
8
 
9
  # Copy dan install
10
  COPY package.json ./
11
+ RUN npm install --production --no-cache
12
 
13
  COPY . .
14
 
15
+ # Limit memory Node.js
16
+ ENV NODE_OPTIONS="--max-old-space-size=1024"
 
17
  ENV PORT=7860
 
18
 
19
+ EXPOSE 7860
20
+
21
+ CMD ["node", "--optimize-for-size", "index.js"]