2024-03-10 16:42:07 +08:00
|
|
|
FROM node:lts AS BUILD_IMAGE
|
2024-03-10 16:16:08 +08:00
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
COPY . /app
|
|
|
|
|
|
|
|
RUN npm i --registry http://registry.npmmirror.com && npm run build
|
|
|
|
|
2024-03-10 16:42:07 +08:00
|
|
|
FROM node:lts-alpine
|
|
|
|
|
2024-04-10 17:56:40 +08:00
|
|
|
COPY --from=BUILD_IMAGE /app/public /app/public
|
|
|
|
COPY --from=BUILD_IMAGE /app/configs /app/configs
|
|
|
|
COPY --from=BUILD_IMAGE /app/package.json /app/package.json
|
|
|
|
COPY --from=BUILD_IMAGE /app/dist /app/dist
|
|
|
|
COPY --from=BUILD_IMAGE /app/node_modules /app/node_modules
|
2024-03-10 16:42:07 +08:00
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
2024-03-10 16:16:08 +08:00
|
|
|
EXPOSE 8000
|
|
|
|
|
|
|
|
CMD ["npm", "start"]
|