Dont run as root in docker
This commit is contained in:
parent
1d3840ba0b
commit
c2747bc489
|
@ -9,10 +9,12 @@ RUN yarn build
|
||||||
# Stage 2 - run
|
# Stage 2 - run
|
||||||
FROM node:12-alpine
|
FROM node:12-alpine
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=build-deps /usr/src/app/build /app/build
|
COPY --chown=node:node --from=build-deps /usr/src/app/build /app/build
|
||||||
COPY --from=build-deps /usr/src/app/public /app/public
|
COPY --chown=node:node --from=build-deps /usr/src/app/public /app/public
|
||||||
COPY --from=build-deps /usr/src/app/node_modules /app/node_modules
|
COPY --chown=node:node --from=build-deps /usr/src/app/node_modules /app/node_modules
|
||||||
VOLUME /app/config
|
VOLUME /app/config
|
||||||
VOLUME /app/content
|
VOLUME /app/content
|
||||||
|
RUN chown node:node /app
|
||||||
|
USER node
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
CMD [ "node", "build/server.js" ]
|
CMD [ "node", "build/server.js" ]
|
||||||
|
|
Loading…
Reference in New Issue