Skip to content

Commit

Permalink
Fix file permissions within docker container
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristophNiehoff committed Aug 14, 2023
1 parent 9cd89ca commit 5e3962f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docker/server.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ COPY ./src ./src
RUN npm run build:server

FROM node:16.13.1-alpine3.14 AS dependency-installer
ENV NODE_ENV production
WORKDIR /usr/src/app
COPY package.json /usr/src/app/
COPY package-lock.json /usr/src/app/
Expand All @@ -16,11 +17,11 @@ RUN npm ci --only=production
FROM node:16.13.1-alpine3.14
RUN apk add dumb-init
WORKDIR /usr/src/app
RUN chown node:node /usr/src/app
USER node
ENV NODE_ENV production
RUN mkdir -p /usr/src/app/db-images
RUN mkdir -p /usr/src/app/db
COPY --chown=node:node --from=builder /usr/src/app/build-server /usr/src/app/build-server
COPY --chown=node:node --from=dependency-installer /usr/src/app/node_modules /usr/src/app/node_modules
COPY --chown=node:node package.json /usr/src/app/
ENV NODE_ENV production
USER node
CMD [ "dumb-init", "node", "--unhandled-rejections=warn", "--es-module-specifier-resolution=node", "/usr/src/app/build-server/server/server.js" ]

0 comments on commit 5e3962f

Please sign in to comment.