Skip to content

Commit

Permalink
chore: use npm prune
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Nov 27, 2023
1 parent fa5b7db commit 2880d9e
Show file tree
Hide file tree
Showing 2 changed files with 1,128 additions and 1,217 deletions.
7 changes: 4 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN \
python3-dev \
npm=9.6.6-r0 \
\
&& npm install --global yarn@2.4.3
&& npm install --global yarn

ENV YARN_HTTP_TIMEOUT=300000
# set production env install will not install devDependencies
Expand All @@ -37,10 +37,11 @@ RUN [ -d 'node_modules' ] && echo "Skipping install" || yarn install --immutable
RUN npm_config_build_from_source=true npm rebuild @serialport/bindings-cpp

# Build back and frontend only when not existing
RUN [ -d 'dist' ] && echo "Skipping build" || yarn build
RUN [ -d 'dist' ] && echo "Skipping build" || npm run build

RUN yarn remove $(cat package.json | jq -r '.devDependencies | keys | join(" ")') && \
RUN npm prune --production && \
rm -rf \
package-lock.json \
build \
package.sh \
src \
Expand Down
Loading

0 comments on commit 2880d9e

Please sign in to comment.