From 4ee5ce80b2bd760767c455db450ee355c8a9898b Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Wed, 19 Jul 2023 17:15:16 +0800 Subject: [PATCH] fix(nocodb): Dockerfile --- packages/nocodb/Dockerfile | 4 +--- packages/nocodb/Dockerfile.local | 4 +--- packages/nocodb/litestream/Dockerfile | 9 +++++---- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/packages/nocodb/Dockerfile b/packages/nocodb/Dockerfile index fe05c90cd0..c2060daf46 100644 --- a/packages/nocodb/Dockerfile +++ b/packages/nocodb/Dockerfile @@ -28,9 +28,7 @@ RUN corepack enable && corepack prepare pnpm@latest --activate RUN apk add --no-cache python3 make g++ # Copy application dependency manifests to the container image. -# A wildcard is used to ensure both package.json AND package-lock.json are copied. -# Copying this separately prevents re-running pnpm install on every code change. -COPY ./package*.json ./ +COPY ./package.json ./package.json COPY ./docker/main.js ./docker/main.js #COPY ./docker/start.sh /usr/src/appEntry/start.sh COPY ./docker/start-litestream.sh /usr/src/appEntry/start.sh diff --git a/packages/nocodb/Dockerfile.local b/packages/nocodb/Dockerfile.local index e375f3bf2a..9b8a0d3b61 100644 --- a/packages/nocodb/Dockerfile.local +++ b/packages/nocodb/Dockerfile.local @@ -11,9 +11,7 @@ RUN apk add --no-cache python3 make g++ RUN corepack enable && corepack prepare pnpm@latest --activate # Copy application dependency manifests to the container image. -# A wildcard is used to ensure both package.json AND package-lock.json are copied. -# Copying this separately prevents re-running pnpm install on every code change. -COPY ./package*.json ./ +COPY ./package.json ./package.json COPY ./docker/nc-gui/ ./docker/nc-gui/ COPY ./docker/main.js ./docker/index.js COPY ./docker/start-local.sh /usr/src/appEntry/start.sh diff --git a/packages/nocodb/litestream/Dockerfile b/packages/nocodb/litestream/Dockerfile index 618f2d0885..07f50c6c9c 100644 --- a/packages/nocodb/litestream/Dockerfile +++ b/packages/nocodb/litestream/Dockerfile @@ -12,12 +12,13 @@ RUN cp $GOPATH/bin/litestream /usr/src/lt -FROM node:12 as builder +FROM node:18.12.1-alpine as builder WORKDIR /usr/src/app +# install pnpm +RUN corepack enable && corepack prepare pnpm@latest --activate + # Copy application dependency manifests to the container image. -# A wildcard is used to ensure both package.json AND package-lock.json are copied. -# Copying this separately prevents re-running pnpm install on every code change. COPY ./package*.json ./ COPY ./docker/main.js ./docker/main.js #COPY ./docker/start.sh /usr/src/appEntry/start.sh @@ -25,7 +26,7 @@ COPY ./docker/start-litestream.sh /usr/src/appEntry/start.sh # install production dependencies, # reduce node_module size with modclean & removing sqlite deps, # package built code into app.tar.gz & add execute permission to start.sh -RUN pnpm install --production --quiet +RUN pnpm install --prod --reporter=silent RUN npx modclean --patterns="default:*" --ignore="nc-lib-gui/**,dayjs/**,express-status-monitor/**" --run RUN rm -rf ./node_modules/sqlite3/deps RUN tar -czf ../appEntry/app.tar.gz ./*