create-dwy 0.16.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/bin/index.js +1 -1
  3. package/package.json +3 -2
  4. package/src/searchable-select.js +419 -0
  5. package/src/sync-all.js +313 -65
  6. package/src/sync-global-skills.js +167 -0
  7. package/src/sync.js +59 -43
  8. package/templates/ai-tools/CHANGELOG.md +210 -0
  9. package/templates/ai-tools/VERSION +1 -0
  10. package/templates/ai-tools/hook-manifests/hooks.json +7 -0
  11. package/templates/ai-tools/hooks/Git/pre-git-commit-ai-signature-check.sh +57 -0
  12. package/templates/ai-tools/rules/Android/dwy-android-core.md +280 -5
  13. package/templates/ai-tools/rules/Docker/dwy-docker.md +52 -1
  14. package/templates/ai-tools/rules/HarmonyOS/dwy-arkts-ui-build.md +50 -1
  15. package/templates/ai-tools/rules/HarmonyOS/dwy-arkts-ui-design.md +139 -0
  16. package/templates/ai-tools/rules/HarmonyOS/dwy-harmony-pitfalls.md +72 -0
  17. package/templates/ai-tools/rules/Python/dwy-python-core.md +47 -0
  18. package/templates/ai-tools/rules/Vue/dwy-vue-core.md +55 -0
  19. package/templates/ai-tools/rules/iOS/dwy-ios-pitfalls.md +7 -0
  20. package/templates/ai-tools/rules/iOS/dwy-swift-core.md +46 -0
  21. package/templates/ai-tools/rules//345/274/200/345/217/221/346/265/201/347/250/213/dwy-git-commit.md +9 -6
  22. package/templates/ai-tools/rules//345/274/200/345/217/221/346/265/201/347/250/213/dwy-oss-commercial-license.md +128 -0
  23. package/templates/ai-tools/skills//345/205/203/345/267/245/345/205/267/dwy-shared/SKILL.md +22 -1
  24. package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-ios-app-store-release/SKILL.md +65 -0
  25. package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-ios-app-store-release/assets/appstore-submission.yaml +43 -0
  26. package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-ios-app-store-release/references/api-workflow.md +17 -0
  27. package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-ios-app-store-release/references/in-app-purchase-review.md +16 -0
  28. package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-ios-app-store-release/references/screenshot-workflow.md +16 -0
  29. package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-ios-app-store-release/scripts/appstore_config.sh +140 -0
  30. package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-publish/SKILL.md +11 -8
  31. package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-publish/references/android.md +2 -1
  32. package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-publish/references/backend-deploy.md +2 -1
  33. package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-publish/references/changelog.md +24 -4
  34. package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-publish/references/frontend-deploy.md +2 -1
  35. package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-publish/references/generic-release.md +2 -1
  36. package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-publish/references/git-tag.md +82 -0
  37. package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-publish/references/harmony.md +2 -1
  38. package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-publish/references/ios.md +3 -2
  39. package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-publish/references/monitor-notify.md +2 -2
  40. package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-semver/SKILL.md +1 -1
  41. package/templates/ai-tools/skills//345/237/272/347/241/200/345/272/223/dwy-eapi/references/tasks-integration-guide.md +2 -2
  42. package/templates/ai-tools/skills//345/256/211/345/205/250/dwy-deploy-audit/SKILL.md +1 -1
  43. package/templates/ai-tools/skills//345/256/211/345/205/250/dwy-deploy-audit/references/checks-runtime.md +2 -2
  44. package/templates/ai-tools/skills//345/256/211/345/205/250/dwy-deploy-audit/scripts/check_docker.sh +3 -3
  45. package/templates/ai-tools/skills//345/256/211/345/205/250/dwy-deploy-audit/scripts/check_secrets.sh +1 -1
  46. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/README.md +57 -0
  47. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/dwy-doubao-tts/SKILL.md +147 -0
  48. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/dwy-doubao-tts/references/api.md +43 -0
  49. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/dwy-doubao-tts/references/config.example.yaml +33 -0
  50. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/dwy-doubao-tts/scripts/global_config.py +89 -0
  51. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/dwy-doubao-tts/scripts/setup_config.py +175 -0
  52. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/dwy-doubao-tts/scripts/synthesize.py +339 -0
  53. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/media-platform-packaging/SKILL.md +127 -0
  54. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/media-platform-packaging/assets/cover-style-master-v1.png +0 -0
  55. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/media-platform-packaging/references/platform-copy-examples.md +37 -0
  56. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/media-platform-packaging/references/platform-posting-times.md +193 -0
  57. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-0005-ideation/SKILL.md +42 -0
  58. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-0005-ideation/templates/topic-backlog.template.md +50 -0
  59. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-0005-ideation/templates//351/200/211/351/242/230/346/261/240.template.md +16 -0
  60. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-0010-product/SKILL.md +106 -0
  61. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-0010-product/templates/channel-profile.template.md +52 -0
  62. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-0010-product/templates//344/272/247/345/223/201/345/215/241.template.md +132 -0
  63. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-0030-facts/SKILL.md +60 -0
  64. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-0030-facts/scripts/build_facts_html.py +430 -0
  65. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-0030-facts/scripts/generate_html.py +1287 -0
  66. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-0030-facts/scripts/generate_report.py +189 -0
  67. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-0030-facts/templates//344/272/213/345/256/236/350/265/204/346/226/231/345/272/223.template.md +55 -0
  68. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-0040-script/SKILL.md +36 -0
  69. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-0040-script/templates/README.md +10 -0
  70. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-0040-script/templates//344/272/213/345/256/236.template.md +82 -0
  71. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-0040-script/templates//345/215/225/351/233/206/346/226/207/346/241/243.template.md +175 -0
  72. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-0040-script/templates//350/204/232/346/234/254.template.md +69 -0
  73. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-0040-script/templates//351/252/250/346/236/266-v1.1.md +174 -0
  74. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-0050-design/SKILL.md +55 -0
  75. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-0060-assets/SKILL.md +29 -0
  76. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-0070-package/SKILL.md +42 -0
  77. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-0070-package/scripts/validate_shots.py +207 -0
  78. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-0070-package/shots.schema.json +186 -0
  79. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-0070-package//344/272/272/345/256/241/345/214/205.template.md +1 -0
  80. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-0070-package//344/272/272/345/256/241/350/257/264/346/230/216.md +15 -0
  81. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-0070-package//346/210/220/347/211/207/345/214/205.template.md +49 -0
  82. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-0080-factory/SKILL.md +58 -0
  83. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-comic-kit/SKILL.md +424 -0
  84. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-comic-kit/evals.md +41 -0
  85. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-flow/CONTRACT.md +123 -0
  86. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-flow/SKILL.md +81 -0
  87. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-flow//346/211/247/350/241/214/346/270/205/345/215/225.template.md +60 -0
  88. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-knowledge-town/SKILL.md +78 -0
  89. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-knowledge-town/agents/openai.yaml +4 -0
  90. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-knowledge-town/assets/knowledge-town-paper-film-v1.json +80 -0
  91. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-knowledge-town/assets/remotion/AudioTracks.tsx +20 -0
  92. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-knowledge-town/assets/remotion/CaptionLayer.tsx +18 -0
  93. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-knowledge-town/assets/remotion/CueTimeline.ts +24 -0
  94. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-knowledge-town/assets/remotion/KnowledgeTownComposition.tsx +21 -0
  95. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-knowledge-town/references/cinematic-direction.md +73 -0
  96. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-knowledge-town/references/sticker-asset-production.md +30 -0
  97. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-knowledge-town/references/style-guide.md +43 -0
  98. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-knowledge-town/scripts/build_cue_timeline.py +75 -0
  99. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-knowledge-town/scripts/validate_cue_timeline.py +68 -0
  100. package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/uc-media-knowledge-town/scripts/validate_style_preset.py +22 -0
  101. package/templates/ai-tools/skills//350/277/220/347/273/264/345/217/221/345/270/203/dwy-deploy-first/SKILL.md +176 -0
  102. package/templates/ai-tools/skills//350/277/220/347/273/264/345/217/221/345/270/203/dwy-deploy-first/references/chapter-01-mirrors.md +112 -0
@@ -0,0 +1,176 @@
1
+ ---
2
+ name: dwy-deploy-first
3
+ description: >-
4
+ 通用「首次部署」检查清单 skill:按章节推进新服务/新镜像的国内可构建落地。
5
+ 当前已开放第 1 章「镜像源」——Dockerfile / 构建环境中的 apt(阿里云)与 uv/pip(阿里云 PyPI);
6
+ 禁止写死具体业务项目名。触发:用户说「首次部署」「第一次上线」「部署第一步」「配置镜像源」
7
+ 「apt 换源」「uv 阿里云」「Docker 构建慢」「国内构建」;或用户执行 /dwy-deploy-first。
8
+ 与 dwy-mirror-source(本机用户级 13 类工具)互补:本 skill 聚焦「项目首次部署构建链路」。
9
+ ---
10
+
11
+ # dwy-deploy-first — 首次部署(分章)
12
+
13
+ 通用流程,**不绑定任何具体仓库或业务名**。按章节执行;用户未点名章节时,从**当前最低未完成章节**开始,完成后询问是否进入下一章。
14
+
15
+ **当前开放章节:** 仅第 1 章(镜像源)。后续章节(构建、健康检查、发布等)待补充,禁止臆造未写章节的强制步骤。
16
+
17
+ **关联 skill(按需读取,勿重复造轮):**
18
+
19
+ | Skill | 边界 |
20
+ | --- | --- |
21
+ | `dwy-mirror-source` | 本机用户级 / 项目级 **开发机** 工具镜像源(pip/uv/npm/Docker daemon 等) |
22
+ | `dwy-docker` | Dockerfile / compose **工程规范**(禁 latest、healthcheck 等) |
23
+ | **本 skill** | **首次部署构建链路**里必须写进仓库的源配置(以 Dockerfile / CI 构建为主) |
24
+
25
+ **参考片段:** `references/chapter-01-mirrors.md`
26
+
27
+ ---
28
+
29
+ ## 总原则
30
+
31
+ 1. **通用模板** — 示例用 `python:3.x-slim-bookworm` 等占位;路径/服务名从用户当前项目推断,不写死历史项目。
32
+ 2. **默认阿里云** — 国内首次部署默认 `aliyun`;用户明确要求清华/中科大时再改。
33
+ 3. **先检查后改** — 扫描现有 `Dockerfile` / `Dockerfile.*` / CI 构建脚本;已合规则静默通过,违规再改。
34
+ 4. **与 dwy-docker 叠加** — 镜像 tag 仍须固定版本;本 skill 不替代版本规范。
35
+ 5. **禁止** `curl https://astral.sh/uv/install.sh` 作为默认装 uv 方式(GitHub 二进制,国内慢/易失败)。
36
+
37
+ ---
38
+
39
+ ## 第 1 章:镜像源(首次部署强制)
40
+
41
+ ### 目标
42
+
43
+ 构建机 / Docker 镜像构建在国内可稳定完成:
44
+
45
+ 1. **apt(Debian/Ubuntu 系)→ 阿里云**
46
+ 2. **uv / pip → 阿里云 PyPI**
47
+
48
+ Alpine / RHEL 系见 `references/chapter-01-mirrors.md`;本章默认以 **Debian/Ubuntu 系官方 Python 基础镜像** 为主(最常见)。
49
+
50
+ ### 1.1 检查清单
51
+
52
+ 扫描用户打开或指定的 Dockerfile / 构建脚本:
53
+
54
+ | # | 检查项 | 合规 | 违规表现 |
55
+ |---|--------|------|----------|
56
+ | A1 | apt 使用国内源 | `mirrors.aliyun.com`(或团队约定的内网 apt 镜像) | 仍 `deb.debian.org` / `archive.ubuntu.com` / `security.debian.org` 且无替换 |
57
+ | A2 | 装 uv 不走 astral.sh 默认 GitHub | `pip install -i https://mirrors.aliyun.com/pypi/simple/ uv` 等 | `curl … astral.sh/uv/install.sh` |
58
+ | A3 | uv 索引 | `UV_INDEX_URL` / `UV_DEFAULT_INDEX` = 阿里云 simple | 未设且会访问 `pypi.org` |
59
+ | A4 | pip 索引 | `PIP_INDEX_URL` 或 `pip -i` = 阿里云 simple | 默认官方 PyPI 且无 `-i` |
60
+ | A5 | trusted-host | 与镜像 host 一致(`mirrors.aliyun.com`) | HTTPS 校验失败或反复警告未处理 |
61
+
62
+ **企业内网私服**(域名非公网 mirror):保留私服,不覆盖为阿里云;记录「已使用私服,本章跳过公网镜像」。
63
+
64
+ ### 1.2 默认 URL(阿里云)
65
+
66
+ ```text
67
+ # Debian/Ubuntu apt
68
+ https://mirrors.aliyun.com/debian/
69
+ https://mirrors.aliyun.com/debian-security/ # 若用 security 源
70
+ https://mirrors.aliyun.com/ubuntu/
71
+
72
+ # PyPI(pip / uv)
73
+ https://mirrors.aliyun.com/pypi/simple/
74
+ trusted-host: mirrors.aliyun.com
75
+ ```
76
+
77
+ ### 1.3 落地动作(Dockerfile 模式)
78
+
79
+ 按顺序改写(最小 diff;匹配用户现有基础镜像代号):
80
+
81
+ #### A. apt → 阿里云
82
+
83
+ - **Debian 12 bookworm(deb822)**:改 `/etc/apt/sources.list.d/debian.sources`
84
+ - **Debian 11 / 旧 sources.list**:改 `/etc/apt/sources.list`
85
+ - **Ubuntu**:改 `sources.list` 或 `ubuntu.sources`
86
+
87
+ 标准片段见 `references/chapter-01-mirrors.md` §apt。
88
+
89
+ `RUN` 中建议:`sed` 换源 → `apt-get update` → `install` → `rm -rf /var/lib/apt/lists/*`。
90
+
91
+ #### B. uv / pip → 阿里云
92
+
93
+ **推荐(安装 uv 本体):**
94
+
95
+ ```dockerfile
96
+ ENV UV_DEFAULT_INDEX=https://mirrors.aliyun.com/pypi/simple/ \
97
+ UV_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/ \
98
+ PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/ \
99
+ PIP_TRUSTED_HOST=mirrors.aliyun.com
100
+
101
+ RUN pip install --no-cache-dir -i https://mirrors.aliyun.com/pypi/simple/ \
102
+ --trusted-host mirrors.aliyun.com \
103
+ "uv>=0.4"
104
+ ```
105
+
106
+ **禁止默认:**
107
+
108
+ ```dockerfile
109
+ # ❌ 国内易慢/失败
110
+ RUN curl -LsSf https://astral.sh/uv/install.sh | sh
111
+ ```
112
+
113
+ **安装项目依赖:**
114
+
115
+ ```dockerfile
116
+ RUN uv pip install --system --no-cache .
117
+ # 或
118
+ RUN uv sync --frozen
119
+ # 环境变量已指向阿里云时无需再写 -i;若未设 ENV,则显式:
120
+ # RUN uv pip install --system --index-url https://mirrors.aliyun.com/pypi/simple/ -r requirements.txt
121
+ ```
122
+
123
+ ### 1.4 非 Docker 首次部署(本机/CI 脚本)
124
+
125
+ 若用户不用 Docker、但在「首次部署」语境配置构建机:
126
+
127
+ | 工具 | 推荐落点 |
128
+ | --- | --- |
129
+ | pip | `PIP_INDEX_URL` 或 `pip.conf` global `index-url` |
130
+ | uv | `~/.config/uv/uv.toml` 的 `[[index]]`,或项目 `pyproject.toml` 的 `[[tool.uv.index]]` |
131
+ | apt | 构建脚本 / 镜像层内 sed;**不**强制改运维员个人笔记本(那是 `dwy-mirror-source`) |
132
+
133
+ 详细用户级配置交给 `dwy-mirror-source`;本 skill 只保证**仓库内可复现的部署构建**写清源。
134
+
135
+ ### 1.5 验收
136
+
137
+ 执行(或指导用户执行)后,确认:
138
+
139
+ 1. Dockerfile / 构建脚本中 **无** 未替换的官方 Debian/Ubuntu 默认源(私服除外)
140
+ 2. **无** 默认 `astral.sh/uv/install.sh`(除非用户书面坚持并接受慢/失败风险)
141
+ 3. `UV_*` / `PIP_*` 指向 `mirrors.aliyun.com`(或约定私服)
142
+ 4. 能完整跑通一次构建(`docker build` 或 `uv sync` / `uv pip install`)且日志显示从阿里云域名拉取
143
+
144
+ 输出简短验收表:
145
+
146
+ ```text
147
+ 第 1 章 镜像源
148
+ - [ ] apt 阿里云
149
+ - [ ] uv/pip 阿里云
150
+ - [ ] 禁止 astral.sh 默认装 uv
151
+ - [ ] 构建试跑通过
152
+ ```
153
+
154
+ ### 1.6 完成后
155
+
156
+ 告知用户:第 1 章已完成。后续章节尚未写入本 skill,**不要自行扩展**未定义的「第 2 章」强制项;若用户继续「首次部署」,询问需求后再扩展 skill 章节。
157
+
158
+ ---
159
+
160
+ ## 反模式(本章)
161
+
162
+ | 反模式 | 正确做法 |
163
+ | --- | --- |
164
+ | 只改本机 `pip.conf`,Dockerfile 仍官方源 | 部署构建以 Dockerfile/CI 为准 |
165
+ | `astral.sh` 装 uv + 仅 pip 换源 | uv 本体也走 `pip -i 阿里云` |
166
+ | 写死某个业务仓库路径/服务名 | 用当前工作区真实路径 |
167
+ | 与 `dwy-mirror-source` 重复扫 13 类本机工具 | 部署构建场景只扫 apt/uv/pip 构建链 |
168
+
169
+ ---
170
+
171
+ ## 章节路线图(占位,未实现勿执行)
172
+
173
+ | 章 | 主题 | 状态 |
174
+ | --- | --- | --- |
175
+ | 1 | 镜像源(apt + uv/pip 阿里云) | **当前** |
176
+ | 2+ | (待定:构建、健康检查、发布等) | 未开放 |
@@ -0,0 +1,112 @@
1
+ # 第 1 章参考:apt / uv / pip 阿里云片段
2
+
3
+ 通用片段,按基础镜像选用。**默认首选阿里云。**
4
+
5
+ ---
6
+
7
+ ## apt — Debian 12 (bookworm, deb822)
8
+
9
+ ```dockerfile
10
+ RUN sed -i \
11
+ 's|deb.debian.org|mirrors.aliyun.com|g; s|security.debian.org|mirrors.aliyun.com|g' \
12
+ /etc/apt/sources.list.d/debian.sources 2>/dev/null \
13
+ || sed -i \
14
+ 's|deb.debian.org|mirrors.aliyun.com|g; s|security.debian.org|mirrors.aliyun.com|g' \
15
+ /etc/apt/sources.list \
16
+ && apt-get update \
17
+ && apt-get install -y --no-install-recommends <packages> \
18
+ && rm -rf /var/lib/apt/lists/*
19
+ ```
20
+
21
+ ## apt — Debian 11 (bullseye)
22
+
23
+ ```dockerfile
24
+ RUN sed -i \
25
+ 's|http://deb.debian.org|https://mirrors.aliyun.com|g; \
26
+ s|http://security.debian.org|https://mirrors.aliyun.com/debian-security|g' \
27
+ /etc/apt/sources.list \
28
+ && apt-get update
29
+ ```
30
+
31
+ ## apt — Ubuntu 22.04
32
+
33
+ ```dockerfile
34
+ RUN sed -i \
35
+ 's|http://archive.ubuntu.com/ubuntu/|https://mirrors.aliyun.com/ubuntu/|g; \
36
+ s|http://security.ubuntu.com/ubuntu/|https://mirrors.aliyun.com/ubuntu/|g' \
37
+ /etc/apt/sources.list \
38
+ && apt-get update
39
+ ```
40
+
41
+ ## apt — Ubuntu 24.04 (noble, deb822)
42
+
43
+ ```dockerfile
44
+ RUN sed -i \
45
+ 's|http://archive.ubuntu.com/ubuntu/|https://mirrors.aliyun.com/ubuntu/|g; \
46
+ s|http://security.ubuntu.com/ubuntu/|https://mirrors.aliyun.com/ubuntu/|g' \
47
+ /etc/apt/sources.list.d/ubuntu.sources \
48
+ && apt-get update
49
+ ```
50
+
51
+ ## apk — Alpine
52
+
53
+ ```dockerfile
54
+ RUN sed -i 's|https://dl-cdn.alpinelinux.org|https://mirrors.aliyun.com|g' \
55
+ /etc/apk/repositories \
56
+ && apk update
57
+ ```
58
+
59
+ ---
60
+
61
+ ## uv + pip 环境变量(推荐写在 Dockerfile 靠前)
62
+
63
+ ```dockerfile
64
+ ENV UV_DEFAULT_INDEX=https://mirrors.aliyun.com/pypi/simple/ \
65
+ UV_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/ \
66
+ PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/ \
67
+ PIP_TRUSTED_HOST=mirrors.aliyun.com
68
+ ```
69
+
70
+ ## 安装 uv(禁止默认 astral.sh)
71
+
72
+ ```dockerfile
73
+ # ✅ 阿里云 PyPI
74
+ RUN pip install --no-cache-dir -i https://mirrors.aliyun.com/pypi/simple/ \
75
+ --trusted-host mirrors.aliyun.com \
76
+ "uv>=0.4"
77
+
78
+ # ❌ 国内易慢
79
+ # RUN curl -LsSf https://astral.sh/uv/install.sh | sh
80
+ ```
81
+
82
+ ## 用 uv 装项目
83
+
84
+ ```dockerfile
85
+ RUN uv pip install --system --no-cache .
86
+ # 或锁文件项目:
87
+ # RUN uv sync --frozen --no-dev
88
+ ```
89
+
90
+ ## 仅 pip(无 uv)
91
+
92
+ ```dockerfile
93
+ RUN pip install --no-cache-dir -i https://mirrors.aliyun.com/pypi/simple/ \
94
+ --trusted-host mirrors.aliyun.com \
95
+ -r requirements.txt
96
+ ```
97
+
98
+ ## 项目级 uv(pyproject.toml,可选)
99
+
100
+ ```toml
101
+ [[tool.uv.index]]
102
+ url = "https://mirrors.aliyun.com/pypi/simple/"
103
+ default = true
104
+ ```
105
+
106
+ ## 用户级 uv(~/.config/uv/uv.toml,可选;开发机详查 dwy-mirror-source)
107
+
108
+ ```toml
109
+ [[index]]
110
+ url = "https://mirrors.aliyun.com/pypi/simple/"
111
+ default = true
112
+ ```