fix: build image libraries for baseline VPS CPUs
Some checks failed
Test and deploy / Verify production build (push) Failing after 15m48s

Replace the SIMD-dependent WebAssembly fallback with source-built libvips and Sharp. Pin the libvips archive checksum, use baseline x86-64 compiler flags, retain the native binding and runtime libraries, and check JPEG/PNG/WebP processing before compilation and in the runtime image.

Lint, type checking, and content/security tests passed. Full Docker verification was stopped at the user request; production build and baseline CPU runtime verification remain pending.
This commit is contained in:
2026-09-15 23:16:54 +03:30
parent 286c9903b8
commit 1f58461967
7 changed files with 254 additions and 58 deletions

View File

@@ -57,10 +57,12 @@ Drizzle Kit, npm installs, or a compiler at runtime. Startup applies the committ
SQL migrations and seeds samples only when the database is empty. `/api/health`
checks database readiness without rendering the portfolio.
Sharp uses native image processing where supported and includes a WebAssembly
fallback for servers without the required x86-64 CPU features. The fallback
preserves uploads and image optimization, but can use more CPU time. Keep
`@img/sharp-wasm32` at the same version as `sharp` when upgrading.
The Docker build compiles libvips and Sharp from source for baseline CPUs. This
supports VPS hosts that lack the features required by Sharp's prebuilt native
and WebAssembly binaries. The first build takes longer; Docker caches the image
libraries for later application changes. Image processing is checked before
Next.js compilation and again in the final runtime image. When upgrading Sharp,
keep the libvips source version in the Dockerfile at or above Sharp's minimum.
Use one application instance with a local filesystem. Do not mount the SQLite
database over NFS/SMB, use an ephemeral serverless disk, or run multiple replicas