Skip to content
This repository has been archived by the owner on May 8, 2018. It is now read-only.

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
- Switch from alpine:edge to node:7.10-alpine image
- Install npm packages and setup offline mode first
- Drop down to less privilege user by default

The `nodejs` alpine package no longer includes `npm`. While I was fixing
that issue I made some additional updates to the `Dockerfile` following
Code Climate engine best practices.
  • Loading branch information
dblandin committed May 11, 2017
1 parent 73c321d commit d9ba63b
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions Dockerfile
@@ -1,12 +1,20 @@
FROM alpine:edge
FROM node:7.10-alpine

WORKDIR /code
ADD . /app
WORKDIR /usr/src/app

COPY package.json ./

RUN apk --update add nodejs curl && \
npm install -g npm && \
cd /app && \
RUN apk --update add curl && \
npm install && \
npm run setup-offline

CMD ["/app/bin/nsp", "check", "--offline", "--warn-only", "-o", "codeclimate"]
RUN adduser -u 9000 -D app
COPY . ./
RUN chown -R app:app ./

USER app

VOLUME /code
WORKDIR /code

CMD ["/usr/src/app/bin/nsp", "check", "--offline", "--warn-only", "--output", "codeclimate"]

0 comments on commit d9ba63b

Please sign in to comment.