ソースを参照

fix(build): fix dockerfile serve issue

Karan Shamspirzadeh 1 ヶ月 前
コミット
9642a5fc54
1 ファイル変更5 行追加4 行削除
  1. 5 4
      Dockerfile

+ 5 - 4
Dockerfile

@@ -26,18 +26,19 @@ COPY . .
 RUN pnpm build
 
 # ---------- runner ----------
-FROM base AS runner
+FROM node:20-alpine AS runner
 
 WORKDIR /app
 
 ENV NODE_ENV=production
 
-RUN pnpm add -g serve
+# install serve LOCAL (not global)
+RUN npm config set registry https://mirror2.chabokan.net/npm/
+RUN npm install -g serve
 
 COPY --from=builder /app/dist ./dist
 
-RUN addgroup -S nodejs
-RUN adduser -S reactjs -G nodejs
+RUN addgroup -S nodejs && adduser -S reactjs -G nodejs
 
 USER reactjs