Skip to content

Commit

Permalink
fix: copy production code to proper dir
Browse files Browse the repository at this point in the history
  • Loading branch information
salim-b committed May 9, 2024
1 parent aca35b5 commit e2967a2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/nocodb/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,10 @@ RUN echo "node-linker=hoisted" > .npmrc

# install production dependencies,
# reduce node_module size with modclean & removing sqlite deps,
# copy built code to /usr/src/appEntry/ & add execute permission to start.sh
# and add execute permission to start.sh
RUN pnpm install --prod --shamefully-hoist \
&& pnpm dlx modclean --patterns="default:*" --ignore="nc-lib-gui/**,dayjs/**,express-status-monitor/**,@azure/msal-node/dist/**" --run \
&& rm -rf ./node_modules/sqlite3/deps \
&& cp -rf ./* ../appEntry/ \
&& chmod +x /usr/src/appEntry/start.sh

##########
Expand All @@ -66,6 +65,7 @@ RUN apk --update --no-cache add \
# Copy litestream binary build
COPY --from=lt-builder /usr/src/lt /usr/src/appEntry/litestream
# Copy production code & main entry file
COPY --from=builder /usr/src/app/ /usr/src/app/
COPY --from=builder /usr/src/appEntry/ /usr/src/appEntry/

EXPOSE 8080
Expand Down
4 changes: 2 additions & 2 deletions packages/nocodb/Dockerfile.local
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@ RUN echo "node-linker=hoisted" > .npmrc

# install production dependencies,
# reduce node_module size with modclean & removing sqlite deps,
# copy built code to /usr/src/appEntry/ & add execute permission to start.sh
# and add execute permission to start.sh
RUN pnpm uninstall nocodb-sdk
RUN pnpm install --prod --shamefully-hoist --reporter=silent \
&& pnpm dlx modclean --patterns="default:*" --ignore="nc-lib-gui/**,dayjs/**,express-status-monitor/**,@azure/msal-node/dist/**" --run \
&& rm -rf ./node_modules/sqlite3/deps \
&& cp -rf ./* ../appEntry/ \
&& chmod +x /usr/src/appEntry/start.sh

##########
Expand All @@ -50,6 +49,7 @@ RUN apk --update --no-cache add \
jq

# Copy production code & main entry file
COPY --from=builder /usr/src/app/ /usr/src/app/
COPY --from=builder /usr/src/appEntry/ /usr/src/appEntry/

EXPOSE 8080
Expand Down
4 changes: 2 additions & 2 deletions packages/nocodb/litestream/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ RUN echo "node-linker=hoisted" > .npmrc

# install production dependencies,
# reduce node_module size with modclean & removing sqlite deps,
# copy built code to /usr/src/appEntry/ & add execute permission to start.sh
# and add execute permission to start.sh
RUN pnpm install --prod --shamefully-hoist --reporter=silent
RUN pnpm dlx modclean --patterns="default:*" --ignore="nc-lib-gui/**,dayjs/**,express-status-monitor/**" --run
RUN rm -rf ./node_modules/sqlite3/deps
RUN cp -rf ./* ../appEntry/
RUN chmod +x /usr/src/appEntry/start.sh

FROM alpine:3.19
Expand Down Expand Up @@ -88,6 +87,7 @@ RUN apk --update --no-cache add \
# Copy litestream binary build
COPY --from=lt /usr/src/lt /usr/src/appEntry/litestream
# Copy production code & main entry file
COPY --from=builder /usr/src/app/ /usr/src/app/
COPY --from=builder /usr/src/appEntry/ /usr/src/appEntry/


Expand Down

0 comments on commit e2967a2

Please sign in to comment.