DP2API / Dockerfile
ffreemt
Update Dockerfile two-stage
306a233
raw
history blame
498 Bytes
FROM node:18-bullseye-slim AS BUILD_IMAGE
WORKDIR /app
COPY . .
RUN yarn install && yarn run build
FROM node:lts-alpine
RUN ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
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/public /app/public
COPY --from=BUILD_IMAGE /app/node_modules /app/node_modules
WORKDIR /app
EXPOSE 7860
CMD [ "npm", "start" ]