22 lines
363 B
Docker
22 lines
363 B
Docker
FROM node:18-alpine AS builder
|
|
RUN mkdir /app
|
|
WORKDIR /app
|
|
|
|
COPY . /app
|
|
|
|
RUN cd /app && npm install && npm build
|
|
|
|
FROM node:18-alpine
|
|
|
|
RUN mkdir /app
|
|
|
|
COPY --from=builder /app/build /app/build
|
|
COPY --from=builder /app/package.json /app/npm.lock /app/
|
|
|
|
RUN cd /app && \
|
|
npm install --production &&\
|
|
npm cache clean
|
|
|
|
WORKDIR /app
|
|
|
|
CMD ["node", "build/index.js"] |