Skip to content

Commit

Permalink
Merge pull request #355 from razee-io/docker_troubleshooting
Browse files Browse the repository at this point in the history
Build: fix npm cache clear
  • Loading branch information
dalehille committed Jul 31, 2020
2 parents 7529294 + 6122e2c commit 9b7f2ae
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 118 deletions.
5 changes: 0 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ RUN apk update \
&& apk add ${BUILD_PACKAGES} \
&& mkdir -p /root \
&& mkdir -p /app \
&& npm config set unsafe-perm true \
&& npm install -g npm@4 \
&& npm install -g node-gyp@latest \
&& node-gyp install \
&& $METEORD_DIR/build_app.sh \
&& $METEORD_DIR/rebuild_npm_modules.sh \
&& apk del --purge ${BUILD_PACKAGES} \
&& $METEORD_DIR/clean-final.sh

Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
}
}
},
"resolutions": {
"elliptic": "^6.5.3"
},
"scripts": {
"preinstall": "npx npm-force-resolutions",
"start": "meteor run",
"debug": "meteor run --inspect",
"lint": "run-s eslint yamllint jsonlint dockerlint markdownlint",
Expand Down
26 changes: 4 additions & 22 deletions private/scripts/build_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,7 @@

set -e

if [ -d /bundle ]; then
cd /bundle
tar xzf *.tar.gz
cd /bundle/bundle/programs/server/
npm install
cd /bundle/bundle/
elif [[ $BUNDLE_URL ]]; then
cd /tmp
curl -L -o bundle.tar.gz $BUNDLE_URL
tar xzf bundle.tar.gz
cd /tmp/bundle/programs/server/
npm install
cd /tmp/bundle/
elif [ -d /app ]; then
cd /app
cd /app/programs/server/
npm install
cd /app
else
echo "=> You don't have an meteor app to run in this image."
exit 1
fi
cd /app
cd /app/programs/server/
npm install
cd /app
3 changes: 1 addition & 2 deletions private/scripts/clean-final.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@

set -e

npm uninstall -g node-gyp
npm cache clear
npm cache clear --force

rm -rf $METEORD_DIR/bin /usr/share/doc /usr/share/man /tmp/* /var/cache/apk/* \
/usr/share/man /tmp/* /var/cache/apk/* /root/.npm /root/.node-gyp #/usr/lib/node_modules/npm
89 changes: 0 additions & 89 deletions private/scripts/rebuild_npm_modules.sh

This file was deleted.

0 comments on commit 9b7f2ae

Please sign in to comment.