feat: add Docker deployment — multi-stage build + nginx SPA serving

This commit is contained in:
kevin-asprec
2026-03-17 04:13:40 +08:00
parent 5376d1b1d5
commit 2340ae58c6
4 changed files with 66 additions and 0 deletions

24
nginx.conf Normal file
View File

@@ -0,0 +1,24 @@
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
# Gzip compression
gzip on;
gzip_types text/plain text/css application/javascript application/json image/svg+xml;
gzip_min_length 1024;
# Cache static assets aggressively
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff2?)$ {
expires 1y;
add_header Cache-Control "public, immutable";
try_files $uri =404;
}
# SPA fallback — all routes serve index.html
location / {
try_files $uri $uri/ /index.html;
}
}