From 57ac6e414f496728e7aac0d0a95d7dc01cb095e5 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Fri, 27 May 2022 15:36:34 +0100 Subject: [PATCH] gyp fixes for slim docker image --- packages/server/Dockerfile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/server/Dockerfile b/packages/server/Dockerfile index d8ad37d80b..f70fdbca95 100644 --- a/packages/server/Dockerfile +++ b/packages/server/Dockerfile @@ -1,7 +1,5 @@ FROM node:14-slim -RUN apt-get update - LABEL com.centurylinklabs.watchtower.lifecycle.pre-check="scripts/watchtower-hooks/pre-check.sh" LABEL com.centurylinklabs.watchtower.lifecycle.pre-update="scripts/watchtower-hooks/pre-update.sh" LABEL com.centurylinklabs.watchtower.lifecycle.post-update="scripts/watchtower-hooks/post-update.sh" @@ -16,8 +14,12 @@ ENV BUDIBASE_ENVIRONMENT=PRODUCTION # copy files and install dependencies COPY . ./ # handle node-gyp -RUN apk add --no-cache --virtual .gyp python3 make g++ \ - && yarn && apk del .gyp +RUN apt-get update \ + && apt-get install -y --no-install-recommends g++ make python \ + && yarn \ + && yarn cache clean \ + && apt-get remove -y --purge --auto-remove g++ make python \ + && rm -rf /tmp/* /root/.node-gyp /usr/local/lib/node_modules/npm/node_modules/node-gyp RUN yarn global add pm2 RUN yarn build