ken4 commited on
Commit
5ec2813
·
verified ·
1 Parent(s): 4d62526

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -8
Dockerfile CHANGED
@@ -1,6 +1,5 @@
1
  FROM node:20
2
 
3
- # Tambahkan arg agar cache selalu invalid (optional)
4
  ARG CACHEBUST=1
5
 
6
  WORKDIR /app
@@ -9,17 +8,17 @@ WORKDIR /app
9
  RUN --mount=type=secret,id=GITHUB_REPO,required=true \
10
  git clone $(cat /run/secrets/GITHUB_REPO) /app
11
 
12
- # Install dependencies
13
- RUN npm install
14
 
15
- # Build project (Nuxt, Express bundler, dll)
16
- RUN npm run build
 
17
 
18
- # Ganti owner biar bisa jalan sebagai user non-root
19
  RUN chown -R node:node /app
20
  USER node
21
 
22
  EXPOSE 7860
23
 
24
- # Jalankan aplikasi
25
- CMD ["npm", "start"
 
1
  FROM node:20
2
 
 
3
  ARG CACHEBUST=1
4
 
5
  WORKDIR /app
 
8
  RUN --mount=type=secret,id=GITHUB_REPO,required=true \
9
  git clone $(cat /run/secrets/GITHUB_REPO) /app
10
 
11
+ # Enable yarn (Corepack)
12
+ RUN corepack enable
13
 
14
+ # Install & build
15
+ RUN yarn install
16
+ RUN yarn build
17
 
18
+ # Perizinan
19
  RUN chown -R node:node /app
20
  USER node
21
 
22
  EXPOSE 7860
23
 
24
+ CMD ["yarn", "start"]