pediatrics-admin/Dockerfile
@zuopngfei 62d2ead615 dsdq
2025-05-19 16:44:51 +08:00

24 lines
673 B
Docker

FROM registry.cn-shanghai.aliyuncs.com/server1024/node:16.17.1 AS build-stage
WORKDIR /mht/
COPY . .
# 设置国内源并调试网络问题
RUN npm config set registry https://registry.npmmirror.com
RUN npm config set network-timeout 600000
RUN npm install --legacy-peer-deps
# 确保 vite 已经全局安装
RUN npm install -g vite
# 检查 vite 是否安装成功
RUN vite --version
# 运行构建命令
RUN npm run build:prod
FROM registry.cn-shanghai.aliyuncs.com/server1024/nginx:base AS production-stage
COPY .docker-compose/nginx/conf.d/my.conf /etc/nginx/conf.d/my.conf
COPY --from=build-stage /mht/dist /usr/share/nginx/html
RUN ls -al /usr/share/nginx/html