chore: 重构image build

This commit is contained in:
xiaojunnuo
2024-07-20 19:38:15 +08:00
parent 0ef7b036dd
commit 4afbf20c1a
2 changed files with 37 additions and 0 deletions

23
packages/ui/Dockerfile Normal file
View File

@@ -0,0 +1,23 @@
FROM registry.cn-shenzhen.aliyuncs.com/handsfree/node:18-alpine as builder
EXPOSE 7001
WORKDIR /workspace/
RUN npm install -g pnpm@8.15.7 --registry=https://registry.npmmirror.com
RUN pnpm config set registry https://registry.npmmirror.com/
RUN cd /workspace/certd-client && pnpm install && npm run build
RUN cd /workspace/certd-server && pnpm install && npm run build
RUN cp /workspace/certd-client/dist/* /workspace/certd-server/public/ -rf
FROM registry.cn-shenzhen.aliyuncs.com/handsfree/node:18-alpine
WORKDIR /app/
COPY --from=builder /workspace/certd-server/ /app/
ENV TZ Asia/Shanghai
ENV NODE_ENV production
ENV MIDWAY_SERVER_ENV production
CMD ["npm", "run","start"]