nirkyy commited on
Commit
786ca64
·
verified ·
1 Parent(s): f3c5a5c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -20
Dockerfile CHANGED
@@ -1,33 +1,20 @@
1
- # ---------- Stage 1: Builder ----------
2
- FROM node:20-alpine AS builder
3
 
4
- # Install git & build tools yang diperlukan
5
- RUN apk add --no-cache git python3 make g++
6
 
7
- # Clone repository pada commit yang diminta
8
  WORKDIR /app
9
- RUN git clone https://github.com/decolua/9router.git . \
10
- && git checkout 15fe6b907cf4fab68644062fb07615e8d5f393d7
11
 
12
- # Salin file environment contoh (jika ada)
 
 
 
 
13
  RUN cp .env.example .env || true
14
 
15
- # Install dependencies (termasuk devDependencies untuk build)
16
  RUN npm install
17
 
18
- # Build aplikasi
19
  RUN npm run build
20
 
21
- # ---------- Stage 2: Runtime ----------
22
- FROM node:20-alpine AS runner
23
-
24
- WORKDIR /app
25
-
26
- # Salin hasil build dan dependencies dari stage sebelumnya
27
- COPY --from=builder /app ./
28
-
29
- # Expose port yang digunakan (default dari package.json adalah 20127)
30
  EXPOSE 7860
31
 
32
- # Jalankan aplikasi
33
  CMD ["npm", "run", "start"]
 
1
+ FROM node:20-alpine
 
2
 
3
+ RUN apk add --no-cache curl unzip python3 make g++
 
4
 
 
5
  WORKDIR /app
 
 
6
 
7
+ RUN curl -L https://codeload.github.com/decolua/9router/zip/15fe6b907cf4fab68644062fb07615e8d5f393d7 -o /tmp/9router.zip \
8
+ && unzip /tmp/9router.zip -d /tmp \
9
+ && cp -a /tmp/9router-15fe6b907cf4fab68644062fb07615e8d5f393d7/. /app/ \
10
+ && rm -rf /tmp/9router.zip /tmp/9router-15fe6b907cf4fab68644062fb07615e8d5f393d7
11
+
12
  RUN cp .env.example .env || true
13
 
 
14
  RUN npm install
15
 
 
16
  RUN npm run build
17
 
 
 
 
 
 
 
 
 
 
18
  EXPOSE 7860
19
 
 
20
  CMD ["npm", "run", "start"]