Browse Source

fix(nocodb): set node-linker=hoisted

pull/5903/head
Wing-Kam Wong 1 year ago
parent
commit
3b32719d1c
  1. 6
      packages/nocodb/Dockerfile
  2. 4
      packages/nocodb/Dockerfile.local
  3. 8
      packages/nocodb/litestream/Dockerfile

6
packages/nocodb/Dockerfile

@ -34,10 +34,14 @@ COPY ./docker/main.js ./docker/main.js
COPY ./docker/start-litestream.sh /usr/src/appEntry/start.sh
COPY src/public/ ./docker/public/
# for pnpm to generate a flat node_modules without symlinks
# so that modclean could work as expected
RUN echo "node-linker=hoisted" > .npmrc
# 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 --prod --shamefully-hoist --reporter=silent \
RUN pnpm install --prod --reporter=silent \
&& npx modclean --patterns="default:*" --ignore="nc-lib-gui/**,dayjs/**,express-status-monitor/**,@azure/msal-node/dist/**" --run \
&& rm -rf ./node_modules/sqlite3/deps \
&& tar -czf ../appEntry/app.tar.gz ./* \

4
packages/nocodb/Dockerfile.local

@ -17,6 +17,10 @@ COPY ./docker/main.js ./docker/index.js
COPY ./docker/start-local.sh /usr/src/appEntry/start.sh
COPY src/public/ ./docker/public/
# for pnpm to generate a flat node_modules without symlinks
# so that modclean could work as expected
RUN echo "node-linker=hoisted" > .npmrc
# 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

8
packages/nocodb/litestream/Dockerfile

@ -23,6 +23,11 @@ COPY ./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
# for pnpm to generate a flat node_modules without symlinks
# so that modclean could work as expected
RUN echo "node-linker=hoisted" > .npmrc
# 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
@ -32,9 +37,6 @@ RUN rm -rf ./node_modules/sqlite3/deps
RUN tar -czf ../appEntry/app.tar.gz ./*
RUN chmod +x /usr/src/appEntry/start.sh
FROM alpine:3.14
#ENV AWS_ACCESS_KEY_ID=

Loading…
Cancel
Save