Files
bchanot 7be94d4ce6 chore(docker): R2 application image with the Rust core — wasm stage, precompressed module, CSP proof on the image
Dockerfile stage 0 (rust:1.99.0-bookworm, wasm32 target, wasm-bindgen-cli
at the builder's pinned version, cargo cache mounts) builds the shipped
module with scripts/wasm-build.sh (WASM_BUILD_SHIPPED_ONLY=1); the Node
stage copies packages/core-wasm (manifest + pkg/); the runner gzips the
module and nginx serves it with gzip_static (application/wasm, 1,180,153
bytes raw, 372,275 served). docker/csp-proof/app-image.sh runs the real
image behind the DEPLOY.md CSP in headless Chromium: with
'wasm-unsafe-eval' a report is created and a zone click is applied by the
core with no script or wasm violation; without it the editor shows the
degraded notice, stays put and leaves the draft untouched; /login,
/app/account and / never request the module (15/15 checks).
2026-10-14 00:45:51 +02:00

31 lines
851 B
Nginx Configuration File

server {
listen ${PORT};
server_name _;
root /usr/share/nginx/html;
index index.html;
# Serve env.js with no-cache so runtime config is always fresh
location = /env.js {
add_header Cache-Control "no-store, no-cache, must-revalidate";
try_files $uri =404;
}
# Assets with long-lived cache (Vite hashes filenames); the core module ships with a
# precompressed .wasm.gz sibling built into the image
location /assets/ {
gzip_static on;
add_header Cache-Control "public, max-age=31536000, immutable";
}
# Species SVGs/JSON: always revalidate (no hash in filename)
location /species/ {
add_header Cache-Control "no-cache";
}
# SPA fallback — serve index.html for all non-file routes
location / {
try_files $uri $uri/ /index.html;
}
}