Skip to content

Commit

Permalink
Add prod Dockerfile for vite-app, running as node user
Browse files Browse the repository at this point in the history
  • Loading branch information
gmarcha committed Aug 12, 2023
1 parent 3711953 commit b2a09ae
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM node:lts-alpine

ENV NPM_CONFIG_PREFIX=/home/node/.npm-global
ENV PATH=$PATH:/home/node/.npm-global/bin

RUN npm i -g pnpm

WORKDIR /home/node/app
RUN mkdir -p /home/node/app

COPY package*.json ./
RUN pnpm install

COPY . .
RUN pnpm build

RUN chown -R node:node /home/node/app
USER node

CMD ["pnpm", "preview", "--host", "0.0.0.0", "--port", "3000"]

EXPOSE 3000

0 comments on commit b2a09ae

Please sign in to comment.