Add idle auto-shutdown configuration to deployment

- IDLE_TIMEOUT_MINUTES env var (default 30 min)
- restart: no policy so container stays stopped
- Optional wakeup service for auto-restart
- Document three restart options in readme
This commit is contained in:
2026-01-29 21:09:53 +00:00
parent b7663d5a31
commit cc5a8191b0
4 changed files with 301 additions and 0 deletions

45
deploy/nginx.conf Normal file
View File

@@ -0,0 +1,45 @@
events {
worker_connections 1024;
}
http {
upstream streamlit {
server streamlit:8080;
}
server {
listen 80;
server_name _;
# Remove X-Frame-Options to allow iframe embedding
proxy_hide_header X-Frame-Options;
# Allow embedding from your domain
add_header Content-Security-Policy "frame-ancestors 'self' https://kschappell.com https://*.kschappell.com";
location / {
proxy_pass http://streamlit;
proxy_http_version 1.1;
# WebSocket support (required for Streamlit)
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# Standard proxy headers
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;
# Timeouts for long-running connections
proxy_read_timeout 86400;
proxy_send_timeout 86400;
}
# Health check endpoint
location /health {
return 200 'ok';
add_header Content-Type text/plain;
}
}
}