- dashboard/Dockerfile: multi-stage — 'dev' (Vite HMR for local compose) and 'prod' (npm build -> nginx static serving, SPA fallback). Prod is the default target so Coolify builds the static app; VITE_API_URL is a build arg. - dashboard/nginx.conf: SPA routing + asset caching + basic security headers. - docker-compose.yml: local frontend targets the dev stage. - app.py: skip the redundant AWS S3 upload in cloud mode (R2 is the store now); add a /health liveness endpoint for uptime checks. Verified: prod image serves index.html + deep-link fallback (200).
22 lines
573 B
Nginx Configuration File
22 lines
573 B
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name _;
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
# Cache hashed assets aggressively; never cache index.html.
|
|
location /assets/ {
|
|
expires 1y;
|
|
add_header Cache-Control "public, immutable";
|
|
try_files $uri =404;
|
|
}
|
|
|
|
# SPA: serve index.html for any route (hash routing / deep links).
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
# Basic security headers.
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
}
|