Files
website/Dockerfile.clean
brunoandQwen-Coder 39ae577965 Feature: Add AI Assistant, Enhanced Search, and Responsive Design Improvements
- Add AIAssistant component for intelligent user support
- Implement EnhancedSearchModal with improved search functionality
- Introduce LazyImage component for optimized image loading
- Update HeroSection with responsive design classes
- Modify Navigation to support dynamic base paths for production
- Update Dockerfile with optimized multi-stage build and health checks
- Configure docker-compose.yml with proper port mapping
- Add comprehensive responsive CSS classes in index.css
- Update routing configuration in App.tsx and main.tsx
- Add development documentation in CLAUDE.md and QWEN.md
- Configure build process with environment-specific base paths
- Add optimization roadmap documentation

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2025-11-17 15:50:09 +08:00

89 lines
2.0 KiB
Docker

# 清除代理配置的 Dockerfile
# 专门解决代理配置冲突问题
# 构建阶段
FROM node:18-alpine as builder
# 明确清除所有代理配置
ENV HTTP_PROXY=""
ENV HTTPS_PROXY=""
ENV http_proxy=""
ENV https_proxy=""
ENV NO_PROXY=""
ENV no_proxy=""
WORKDIR /app
# 使用国内镜像源加速 apk 包管理
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
# 清除 npm 代理配置并设置国内镜像源
RUN npm config delete proxy && \
npm config delete https-proxy && \
npm config set registry https://registry.npmmirror.com && \
npm config set cache /tmp/.npm --global
# 安装 pnpm
RUN npm install -g pnpm
# 复制 package 文件
COPY package.json pnpm-lock.yaml ./
# 清除 pnpm 代理配置并设置国内镜像源
RUN pnpm config delete proxy && \
pnpm config delete https-proxy && \
pnpm config set registry https://registry.npmmirror.com
# 安装依赖
RUN pnpm install --frozen-lockfile
# 复制源代码
COPY . .
# 构建应用
RUN npm run build
# 生产阶段
FROM node:18-alpine
# 清除所有代理配置
ENV HTTP_PROXY=""
ENV HTTPS_PROXY=""
ENV http_proxy=""
ENV https_proxy=""
ENV NO_PROXY=""
ENV no_proxy=""
WORKDIR /app
# 使用国内镜像源
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
# 清除 npm 代理配置并设置国内镜像源
RUN npm config delete proxy && \
npm config delete https-proxy && \
npm config set registry https://registry.npmmirror.com
# 安装 pnpm 和 serve
RUN npm install -g pnpm serve
# 复制构建产物
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/package.json ./
COPY --from=builder /app/pnpm-lock.yaml ./
# 安装生产依赖
RUN pnpm install --prod --frozen-lockfile
# 清理缓存
RUN npm cache clean --force
# 暴露端口
EXPOSE 5173
# 健康检查
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:5173 || exit 1
# 启动应用
CMD ["serve", "-s", "dist", "-l", "5173"]