Skip to content

Commit

Permalink
Add Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
TSRBerry committed Jun 9, 2023
1 parent 551b9b1 commit fafcbd1
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dist/
node_modules/
data/
.github/
.git/
README.md
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM node:lts-hydrogen as common

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

FROM common as build

COPY . /home/node/app

RUN pnpm install --frozen-lockfile
RUN pnpm build

FROM common as app

COPY --from=build --chown=node:node /home/node/app/dist /home/node/app/dist
COPY --from=build --chown=node:node /home/node/app/package.json /home/node/app/pnpm-lock.yaml /home/node/app/
COPY --from=build --chown=node:node /home/node/app/node_modules /home/node/app/node_modules

RUN mkdir /home/node/app/data

ENTRYPOINT [ "node", "." ]

0 comments on commit fafcbd1

Please sign in to comment.