2024-05-29 22:10:06 +00:00
|
|
|
FROM node:18-alpine AS builder
|
|
|
|
RUN mkdir /app
|
|
|
|
WORKDIR /app
|
2024-05-29 21:28:58 +00:00
|
|
|
|
2024-05-29 22:10:06 +00:00
|
|
|
COPY . /app
|
2024-05-29 21:28:58 +00:00
|
|
|
|
2024-05-29 22:10:06 +00:00
|
|
|
RUN cd /app && npm install && npm build
|
2024-05-29 21:28:58 +00:00
|
|
|
|
2024-05-29 22:10:06 +00:00
|
|
|
FROM node:18-alpine
|
2024-05-29 21:28:58 +00:00
|
|
|
|
2024-05-29 22:10:06 +00:00
|
|
|
RUN mkdir /app
|
2024-05-29 21:28:58 +00:00
|
|
|
|
2024-05-29 22:10:06 +00:00
|
|
|
COPY --from=builder /app/build /app/build
|
|
|
|
COPY --from=builder /app/package.json /app/npm.lock /app/
|
2024-05-29 21:28:58 +00:00
|
|
|
|
2024-05-29 22:10:06 +00:00
|
|
|
RUN cd /app && \
|
|
|
|
npm install --production &&\
|
|
|
|
npm cache clean
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
CMD ["node", "build/index.js"]
|