Skip to content

move npm audit to CI from Dockerfile #228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ install:
- npm install -g codecov
- npm install
script:
- npm audit # if npm audit fails, run `npm audit fix` and commit the results
- npm run lint
- travis_retry npm test
after_success:
9 changes: 3 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:12.16.1-alpine
FROM node:12-alpine
# ref: https://hub.docker.com/_/node?tab=tags&name=12

LABEL maintainer="Jupyter Project <[email protected]>"
@@ -10,11 +10,8 @@ RUN mkdir -p /srv/configurable-http-proxy
COPY . /srv/configurable-http-proxy
WORKDIR /srv/configurable-http-proxy

# Install configurable-http-proxy, then automatically install compatible updates
# to vulnerable dependencies, and finally uninstall npm which isn't needed.
RUN npm install -g --production \
&& npm audit fix \
&& npm uninstall -g npm
# Install configurable-http-proxy
RUN npm install -g --production

# Switch from the root user to the nobody user
USER 65534