Skip to content

Commit

Permalink
fix(Dockerfile): use different workdir to prevent EACCESS errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kdev committed Aug 6, 2023
1 parent c98f461 commit 24d1c43
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
FROM node:18.16.0-alpine as build
WORKDIR /usr/app
WORKDIR /home/node/
COPY . .
RUN npm pkg delete scripts.prepare
RUN npm ci
RUN npm run build

FROM node:18.16.0-alpine as cleanup
WORKDIR /usr/app
COPY --from=build /usr/app/package*.json ./
COPY --from=build /usr/app/dist ./dist
COPY --from=build /usr/app/prisma ./prisma
WORKDIR /home/node/
COPY --from=build /home/node/package*.json ./
COPY --from=build /home/node/dist ./dist
COPY --from=build /home/node/prisma ./prisma
RUN npm ci --omit=dev

FROM node:18.16.0-alpine
WORKDIR /usr/app
COPY --from=cleanup /usr/app ./
WORKDIR /home/node/
COPY --from=cleanup /home/node/ ./
USER 1000

EXPOSE 3000
Expand Down

0 comments on commit 24d1c43

Please sign in to comment.