-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from icgc-argo/16-update-docker-security
16 update docker security
- Loading branch information
Showing
1 changed file
with
22 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |