瀏覽代碼

fix: add make dependency in dockerfile

Nicolas Meienberger 2 年之前
父節點
當前提交
d91dedc580
共有 2 個文件被更改,包括 8 次插入5 次删除
  1. 7 4
      Dockerfile
  2. 1 1
      Dockerfile.dev

+ 7 - 4
Dockerfile

@@ -1,4 +1,4 @@
-FROM node:18-alpine3.16 AS build
+FROM node:18 AS build
 
 
 RUN npm install node-gyp -g
 RUN npm install node-gyp -g
 
 
@@ -23,17 +23,20 @@ FROM node:18-alpine3.16 as app
 
 
 WORKDIR /
 WORKDIR /
 
 
-RUN apk --no-cache add g++
 # Install dependencies
 # Install dependencies
+RUN apk --no-cache add python3
+RUN apk --no-cache add make
+RUN apk --no-cache add build-base
+
 RUN npm install node-gyp -g
 RUN npm install node-gyp -g
 
 
 WORKDIR /api
 WORKDIR /api
 COPY ./packages/system-api/package*.json /api/
 COPY ./packages/system-api/package*.json /api/
-RUN npm install --production
+RUN npm install --omit=dev
 
 
 WORKDIR /dashboard
 WORKDIR /dashboard
 COPY ./packages/dashboard/package*.json /dashboard/
 COPY ./packages/dashboard/package*.json /dashboard/
-RUN npm install --production
+RUN npm install --omit=dev
 
 
 COPY --from=build /api/dist /api/dist
 COPY --from=build /api/dist /api/dist
 COPY --from=build /dashboard/.next /dashboard/.next
 COPY --from=build /dashboard/.next /dashboard/.next

+ 1 - 1
Dockerfile.dev

@@ -2,7 +2,7 @@ FROM node:18-alpine3.16
 
 
 WORKDIR /
 WORKDIR /
 
 
-RUN apk --no-cache add g++
+RUN apk --no-cache add g++ make
 RUN npm install node-gyp -g
 RUN npm install node-gyp -g
 
 
 WORKDIR /api
 WORKDIR /api