# GitHub Actions 构建用的 Dockerfile # 使用预构建的产物,不包含源代码构建过程 FROM nginx:alpine # 复制 nginx 配置文件 COPY nginx.conf /etc/nginx/conf.d/default.conf # 清理默认的 nginx 静态文件 RUN rm -rf /usr/share/nginx/html/* # 复制构建产物到 nginx 静态文件目录 # 这里的 docs 目录是在 GitHub Actions 中构建生成的 COPY docs /usr/share/nginx/html # 暴露端口 EXPOSE 80 # 启动 nginx CMD ["nginx", "-g", "daemon off;"]