Skip to content

Commit

Permalink
fix: remove running the image as the uploader user
Browse files Browse the repository at this point in the history
  • Loading branch information
kespinola committed Oct 6, 2023
1 parent 0d6f92c commit 1d8d212
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
FROM node:20-alpine AS base
WORKDIR /app
RUN addgroup -g 10000 uploader && adduser -u 10000 -G uploader -s /bin/sh -D uploader
ENV HOME=/app
RUN chown -R uploader:uploader /app
USER uploader
COPY --chown=uploader:uploader package*.json ./
COPY package*.json ./

FROM base AS dependencies
RUN npm set progress=false && npm config set depth 0 && \
Expand All @@ -14,10 +11,10 @@ RUN npm install

FROM dependencies AS build
ENV NODE_ENV=production
COPY --chown=uploader:uploader . .
COPY . .

FROM base AS release
COPY --from=dependencies /app/prod_node_modules ./node_modules
COPY --chown=uploader:uploader . .
COPY . .
EXPOSE 3000
CMD ["npm","start"]

0 comments on commit 1d8d212

Please sign in to comment.