# 共享前端 Dockerfile - 使用预构建的 dist 目录 FROM nginx:1.25-alpine # 复制 nginx 配置 COPY nginx-shared.conf /etc/nginx/conf.d/default.conf # dist 目录通过 volume 挂载,不在构建时复制 # 健康检查 HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \ CMD wget --no-verbose --tries=1 --spider http://localhost:80/ || exit 1 EXPOSE 80 CMD ["nginx", "-g", "daemon off;"]