- packages/bridge/Dockerfile: multi-stage build (node:22-alpine) - frontend/Dockerfile: multi-stage build + nginx:alpine - frontend/nginx.conf: proxy /bridge to bridge service - docker-compose.yml: bridge (3456) + frontend (8080) - .dockerignore: exclude backend/node_modules/dist - Fix vite proxy target to port 3456 - .env with bridge vars (AUTH_MODE=dev)
39 lines
1.5 KiB
Nginx Configuration File
39 lines
1.5 KiB
Nginx Configuration File
# ─────────────────────────────────────────────────────────────
|
|
# nginx.conf — Frontend container configuration
|
|
# Serves Vite SPA and proxies /bridge to the bridge service
|
|
# ─────────────────────────────────────────────────────────────
|
|
|
|
server {
|
|
listen 80;
|
|
server_name _;
|
|
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
# Proxy /bridge requests to the bridge Express service
|
|
location /bridge/ {
|
|
proxy_pass http://bridge:3456/bridge/;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header Connection "";
|
|
|
|
# Timeouts for slow hermes CLI calls
|
|
proxy_read_timeout 60s;
|
|
proxy_send_timeout 60s;
|
|
proxy_connect_timeout 10s;
|
|
}
|
|
|
|
# SPA fallback — serve index.html for client-side routes
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
# Cache static assets aggressively (Vite hashes filenames)
|
|
location /assets/ {
|
|
expires 1y;
|
|
add_header Cache-Control "public, immutable";
|
|
}
|
|
}
|