2021-10-06 15:24:55 +00:00
|
|
|
FROM node:16-slim as builder
|
|
|
|
|
2021-10-06 17:47:31 +00:00
|
|
|
RUN mkdir /app
|
|
|
|
COPY package.json /app/
|
|
|
|
COPY package-lock.json /app/
|
2021-10-06 15:24:55 +00:00
|
|
|
WORKDIR /app
|
2021-10-06 17:47:31 +00:00
|
|
|
RUN npm ci
|
|
|
|
COPY . /app
|
|
|
|
RUN npm run build
|
2021-10-06 15:24:55 +00:00
|
|
|
|
|
|
|
FROM node:16-slim
|
|
|
|
|
|
|
|
COPY --from=builder /app/dist/ /app/
|
|
|
|
COPY --from=builder /app/package.json /app/
|
|
|
|
COPY --from=builder /app/package-lock.json /app/
|
|
|
|
COPY --from=builder /app/static/ /app/static/
|
|
|
|
COPY --from=builder /app/templates/ /app/templates/
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
RUN npm install --production
|
|
|
|
|
|
|
|
CMD ["/usr/local/bin/node", "index.js"]
|