Created
May 18, 2019 06:29
-
-
Save keidrun/e43a6a6d7c1d5641feff7ed0175f2c56 to your computer and use it in GitHub Desktop.
How to change permission for node user on a dockerized NodeJS app
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
FROM node:12.2-alpine | |
ENV NODE_ENV=production | |
WORKDIR /node | |
COPY package.json yarn.lock ./ | |
RUN mkdir app && chown -R node:node . | |
USER node | |
RUN yarn install && yarn cache clean --force | |
WORKDIR /node/app | |
COPY --chown=node:node . . | |
EXPOSE 3000 | |
CMD ["node", "app.js"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment