Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
Run application with a non-root user inside docker.
  • Loading branch information
abehnamfard authored Apr 6, 2020
1 parent 3f94222 commit 1e3195d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
FROM node:12.13-alpine
FROM node:alpine

RUN mkdir -p /usr/src/node-app
RUN mkdir -p /usr/src/node-app && chown -R node:node /usr/src/node-app

WORKDIR /usr/src/node-app

COPY package.json yarn.lock ./

USER node

RUN yarn install --pure-lockfile

COPY . .
COPY --chown=node:node . .

EXPOSE 3000

0 comments on commit 1e3195d

Please sign in to comment.