Skip to content

Commit

Permalink
feat(docker): review user to do nothing in root ✨
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreBrisorgueil committed Apr 27, 2020
1 parent 1030daa commit 6ec0a82
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
FROM node:lts-slim

# Create app directory
WORKDIR /usr/src/app
# switch user
USER node

# Install app dependencies
COPY package*.json ./
RUN npm install
# Create app directory
WORKDIR /home/node

# Bundle app source
COPY . .
# Install app dependencies & setup
COPY --chown=node:node package*.json ./
RUN npm install --production
COPY --chown=node:node . .

# Expose
EXPOSE 80 443 3000 35729 8080

# Command to run the executable
# Command to run
CMD [ "node", "server.js" ]

0 comments on commit 6ec0a82

Please sign in to comment.