1
0

add dockerfile and build file

This commit is contained in:
2024-07-17 22:21:40 +02:00
parent 6e802434db
commit 436ba4a36b
3 changed files with 52 additions and 0 deletions

21
Dockerfile Normal file
View File

@ -0,0 +1,21 @@
FROM node:22
COPY build/ /home/node/app
ENTRYPOINT ["node", "build/index.js"]
FROM node:22 as builder
COPY . /src/
WORKDIR /src/
RUN npm install
RUN npm run build
RUN cp package.json ./build/package.json
RUN cp package-lock.json ./build/package-lock.json
RUN cd build && npm ci --production
RUN rm package.json && rm package-lock.json
FROM node:22 as runner
COPY --from=builder /src/build/ /home/node/app
ENTRYPOINT [ "node", "/home/node/app/index.js" ]