Skip to content

Commit

Permalink
Merge pull request #17 from icgc-argo/16-update-docker-security
Browse files Browse the repository at this point in the history
16 update docker security
  • Loading branch information
rtisma authored Mar 9, 2020
2 parents 5e8ddb1 + 6e9be23 commit 6d97c77
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
FROM node:10
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm ci
FROM node:10-alpine

ENV NODE_ENV=production
ENV HOST=localhost
ENV APP_UID=9999
ENV APP_GID=9999
ENV APP_USER=node
ENV APP_HOME=/usr/src/app

WORKDIR $APP_HOME

COPY package*.json ./

RUN apk --no-cache add shadow \
&& groupmod -g $APP_GID $APP_USER \
&& usermod -u $APP_UID -g $APP_GID $APP_USER \
&& chown -R $APP_UID:$APP_GID $APP_HOME \
&& rm -rf /var/cache/apk/* \
&& npm ci

USER $APP_UID

COPY . ./

EXPOSE 3000
CMD node merge.js -o merged.json WES-swagger-template.json $WF_SEARCH_API $WF_MANAGEMENT_API && node app.js

0 comments on commit 6d97c77

Please sign in to comment.