Commit e011cf4
feat: add package cache warming for faster container startup (#13)
* feat: add package cache warming for faster container startup
Pre-populate npm, cargo, and pip caches during Docker image build time
so that first-time package installations are significantly faster.
Changes:
- base-system.Dockerfile: npm cache add for ~25 common packages (React,
Next, Vite, TypeScript, testing, styling, utilities)
- intermediate/rust.Dockerfile: cargo fetch for common crates (tokio,
serde, anyhow, reqwest, clap, etc.)
- generate_docker.js: new generateCacheWarmCommands() function with
support for npm, cargo, and pip cache warming in generated Dockerfiles
- config.json: updated rust template + added cache_warm configs to
ethereum, solana, tangle, universal, and langchain projects
Expected impact:
- npm install react: ~5s → <1s
- npm create vite: ~15s → ~2s
- cargo build (new project): ~60s → ~10s
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: ensure cargo cache permissions and pip compatibility
- Add chmod -R a+w $CARGO_HOME after cargo fetch to ensure cache files
are writable by the project user (not just root)
- Add --break-system-packages flag to pip download for consistency with
other pip commands and compatibility with newer pip versions
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>1 parent efe8cde commit e011cf4
File tree
4 files changed
+164
-7
lines changed- base
- intermediate
4 files changed
+164
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
23 | 49 | | |
24 | 50 | | |
25 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
54 | 63 | | |
55 | 64 | | |
56 | 65 | | |
| |||
89 | 98 | | |
90 | 99 | | |
91 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
92 | 116 | | |
93 | 117 | | |
94 | 118 | | |
| |||
137 | 161 | | |
138 | 162 | | |
139 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
140 | 172 | | |
141 | 173 | | |
142 | 174 | | |
| |||
180 | 212 | | |
181 | 213 | | |
182 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
183 | 230 | | |
184 | 231 | | |
185 | 232 | | |
| |||
460 | 507 | | |
461 | 508 | | |
462 | 509 | | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
463 | 519 | | |
464 | 520 | | |
465 | 521 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
16 | 58 | | |
17 | 59 | | |
18 | 60 | | |
| |||
72 | 114 | | |
73 | 115 | | |
74 | 116 | | |
75 | | - | |
| 117 | + | |
76 | 118 | | |
77 | 119 | | |
78 | 120 | | |
79 | 121 | | |
80 | 122 | | |
81 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
82 | 129 | | |
83 | 130 | | |
84 | 131 | | |
| |||
127 | 174 | | |
128 | 175 | | |
129 | 176 | | |
130 | | - | |
| 177 | + | |
| 178 | + | |
131 | 179 | | |
132 | 180 | | |
133 | 181 | | |
| |||
136 | 184 | | |
137 | 185 | | |
138 | 186 | | |
139 | | - | |
| 187 | + | |
140 | 188 | | |
141 | 189 | | |
142 | 190 | | |
| |||
151 | 199 | | |
152 | 200 | | |
153 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
154 | 209 | | |
155 | 210 | | |
156 | 211 | | |
| |||
198 | 253 | | |
199 | 254 | | |
200 | 255 | | |
201 | | - | |
| 256 | + | |
202 | 257 | | |
203 | 258 | | |
204 | 259 | | |
205 | 260 | | |
206 | 261 | | |
207 | | - | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
208 | 274 | | |
209 | 275 | | |
210 | 276 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
11 | 20 | | |
12 | 21 | | |
13 | 22 | | |
0 commit comments