From 339b24fd95d08dc607c028649a91a4e05b88f2d5 Mon Sep 17 00:00:00 2001 From: sanbuphy Date: Fri, 15 May 2026 10:50:51 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E9=AD=94=E6=90=AD?= =?UTF-8?q?=E5=88=9B=E7=A9=BA=E9=97=B4=20(ModelScope=20Studio)=20Docker=20?= =?UTF-8?q?=E9=83=A8=E7=BD=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .dockerignore | 13 +++++++++++++ Dockerfile | 29 +++++++++++++++++++++++++++++ docs/public/sitemap.xml | 18 +++++++++--------- ms_deploy.json | 6 ++++++ nginx.conf | 25 +++++++++++++++++++++++++ 5 files changed, 82 insertions(+), 9 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 ms_deploy.json create mode 100644 nginx.conf diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..1f9ac4e --- /dev/null +++ b/.dockerignore @@ -0,0 +1,13 @@ +# Easy-Vibe 魔搭创空间部署:排除不需要打入镜像的文件和目录 +node_modules +.git +.github +.husky +.trae +.vscode +docs/.vitepress/dist +docs/.vitepress/cache +temp +assets +.claude +docs-readme diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..76f57b1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,29 @@ +# ============================================================ +# Easy-Vibe 魔搭创空间 (ModelScope Studio) 部署镜像 +# 使用多阶段构建:先编译 VitePress 静态站点,再用 Nginx 提供服务 +# 魔搭要求服务端口为 7860,通过 nginx.conf 配置监听 +# ============================================================ + +# ---- 构建阶段:Node.js 编译 VitePress 文档站 ---- +FROM node:20-alpine AS builder + +WORKDIR /app + +COPY package.json package-lock.json ./ + +RUN npm ci + +COPY . . + +RUN npm run build + +# ---- 运行阶段:Nginx 提供静态文件服务 ---- +FROM nginx:alpine + +COPY nginx.conf /etc/nginx/conf.d/default.conf + +COPY --from=builder /app/docs/.vitepress/dist /usr/share/nginx/html + +EXPOSE 7860 + +CMD ["nginx", "-g", "daemon off;"] diff --git a/docs/public/sitemap.xml b/docs/public/sitemap.xml index 6cbe2f2..b7d0815 100644 --- a/docs/public/sitemap.xml +++ b/docs/public/sitemap.xml @@ -3,7 +3,7 @@ xmlns:xhtml="http://www.w3.org/1999/xhtml"> https://datawhalechina.github.io/easy-vibe/zh-cn/ - 2026-04-02T13:48:55+08:00 + 2026-05-14T12:39:03+08:00 weekly 1.0 @@ -573,7 +573,7 @@ https://datawhalechina.github.io/easy-vibe/zh-cn/appendix/7-infrastructure-and-operations/load-balancing-gateway/ - 2026-02-15T01:57:52+08:00 + 2026-05-12T01:15:35+08:00 weekly 0.7 @@ -772,7 +772,7 @@ https://datawhalechina.github.io/easy-vibe/zh-cn/stage-1/ai-capabilities-through-games/ - 2026-05-11T17:11:47+09:00 + 2026-05-12T09:55:02+09:00 weekly 0.9 @@ -781,7 +781,7 @@ https://datawhalechina.github.io/easy-vibe/zh-cn/stage-1/appendix-a-product-thinking/ - 2026-05-11T17:11:47+09:00 + 2026-05-12T09:55:02+09:00 weekly 0.9 @@ -790,7 +790,7 @@ https://datawhalechina.github.io/easy-vibe/zh-cn/stage-1/appendix-articles/example0-1/vibe-coding-tools-snake-game-tutorial/ - 2026-05-11T17:11:47+09:00 + 2026-05-12T09:55:02+09:00 weekly 0.9 @@ -799,7 +799,7 @@ https://datawhalechina.github.io/easy-vibe/zh-cn/stage-1/appendix-articles/example0-2/vibe-coding-tools-build-website-with-ai-coding-and-design-agents/ - 2026-05-11T17:11:47+09:00 + 2026-05-12T09:55:02+09:00 weekly 0.9 @@ -880,7 +880,7 @@ https://datawhalechina.github.io/easy-vibe/zh-cn/stage-1/building-prototype/ - 2026-05-11T17:11:47+09:00 + 2026-05-12T09:55:02+09:00 weekly 0.9 @@ -907,7 +907,7 @@ https://datawhalechina.github.io/easy-vibe/zh-cn/stage-1/integrating-ai-capabilities/ - 2026-05-11T17:11:47+09:00 + 2026-05-12T09:55:02+09:00 weekly 0.9 @@ -916,7 +916,7 @@ https://datawhalechina.github.io/easy-vibe/zh-cn/stage-1/introduction-to-ai-ide/ - 2026-05-11T17:11:47+09:00 + 2026-05-12T09:55:02+09:00 weekly 0.9 diff --git a/ms_deploy.json b/ms_deploy.json new file mode 100644 index 0000000..febd0cb --- /dev/null +++ b/ms_deploy.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://modelscope.cn/api/v1/studios/deploy_schema.json", + "sdk_type": "docker", + "resource_configuration": "platform/2v-cpu-16g-mem", + "port": 7860 +} diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..03b75bc --- /dev/null +++ b/nginx.conf @@ -0,0 +1,25 @@ +# ============================================================ +# Easy-Vibe 魔搭创空间 (ModelScope Studio) Nginx 配置 +# 为 VitePress 静态站点提供 Web 服务,监听魔搭要求的 7860 端口 +# ============================================================ + +server { + listen 7860; + server_name localhost; + + root /usr/share/nginx/html; + index index.html; + + gzip on; + gzip_types text/plain text/css application/json application/javascript text/xml application/xml text/javascript image/svg+xml; + gzip_min_length 1024; + + location / { + try_files $uri $uri.html $uri/ /index.html; + } + + location /assets/ { + expires 1y; + add_header Cache-Control "public, immutable"; + } +}