Initial commit: Loma PDF Editor with Coolify deploy setup

Browser-only PDF editor (React + Vite + pdf-lib + pdf.js + tesseract.js),
plus a multi-stage Dockerfile that builds the SPA and serves it from nginx
on port 80 with a /health endpoint for Coolify.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chaloemphong
2026-11-19 10:02:45 +07:00
commit ac91737c63
54 changed files with 8994 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
server {
listen 80;
root /usr/share/nginx/html;
index index.html;
gzip on;
gzip_types text/css application/javascript application/json image/svg+xml application/wasm;
client_max_body_size 1m;
# pdf.js worker ships as hashed .mjs; module workers need a JavaScript MIME type.
location ~* \.mjs$ {
types { }
default_type application/javascript;
expires 1y;
add_header Cache-Control "public, immutable";
try_files $uri =404;
}
location = /health {
access_log off;
default_type text/plain;
return 200 "ok\n";
}
# Vite assets carry a content hash -> cache forever.
location /assets/ {
expires 1y;
add_header Cache-Control "public, immutable";
try_files $uri =404;
}
# Unhashed static files (fonts, logo, pdf.js cmaps): cache, but revalidate.
location ~* \.(?:woff2?|ttf|png|jpg|jpeg|gif|ico|webp|svg|bcmap|pfb)$ {
add_header Cache-Control "public, max-age=86400";
try_files $uri =404;
}
# index.html must always be fresh so users get new releases.
location / {
add_header Cache-Control "no-cache";
try_files $uri $uri/ /index.html;
}
}