Entrypoints and Hot Reload
Hot reload is a development technique that allows your application to automatically update when it detects changes in the source code. This is especially useful during development to speed up the iteration process, since you can edit directly your files from MINEO.
For Development vs Production
Hot reload configurations are primarily designed for development environments. In production, it's recommended to use standard entrypoints without automatic reload for better stability and performance.
Two rules for every framework
- Poll for changes. The project folder is a network volume, so the operating system does not report file changes. Without polling, the app never reloads.
- Watch code only. A watcher on every file restarts the app each time it writes its own data (a SQLite file, uploads, logs).
The commands below follow both rules.
Streamlit: Native Hot Reload
Streamlit includes its own efficient hot reload system that doesn't require additional tools:
# For development (with native hot reload)
pip install -q --no-cache-dir streamlit && streamlit run app.py --server.port 8000 --server.address 0.0.0.0 --server.runOnSave=true --server.fileWatcherType=poll
# For production (without hot reload)
pip install -q --no-cache-dir streamlit && streamlit run app.py --server.port 8000 --server.address 0.0.0.0
Advantages of Streamlit's native approach:
- Faster and more efficient
- Better framework integration
- Lower resource consumption
FastAPI: uvicorn Reload
uvicorn has its own reload, which watches .py files only. WATCHFILES_FORCE_POLLING=true makes it poll:
# For development (with hot reload)
pip install -q --no-cache-dir fastapi uvicorn watchfiles && WATCHFILES_FORCE_POLLING=true uvicorn main:app --reload --host 0.0.0.0 --port 8000 --proxy-headers --forwarded-allow-ips='*' --root-path "${MINEO_LIVE_APP_URL_PATH%/}"
# For production (without hot reload)
pip install -q --no-cache-dir fastapi uvicorn && uvicorn main:app --host 0.0.0.0 --port 8000 --proxy-headers --forwarded-allow-ips='*' --root-path "${MINEO_LIVE_APP_URL_PATH%/}"
The --proxy-headers --forwarded-allow-ips='*' --root-path "${MINEO_LIVE_APP_URL_PATH%/}" flags tell the app it is served behind MINEO's proxy. Set the prefix here and never as root_path= in the FastAPI() constructor, which would overwrite it.
With --root-path, mounted static files work too, with no wrapper: see Static files and the path prefix.
Other Frameworks: Using Watchfiles
For Gradio, Dash, or custom applications, use watchfiles. --filter python restarts the app on .py changes only.
Gradio with Hot Reload
# For development (with watchfiles)
pip install -q --no-cache-dir watchfiles gradio && WATCHFILES_FORCE_POLLING=true watchfiles --filter python "python app.py" .
# For production (without hot reload)
pip install -q --no-cache-dir gradio && python app.py
Custom Application
# For development (with watchfiles)
pip install -q --no-cache-dir watchfiles && WATCHFILES_FORCE_POLLING=true watchfiles --filter python "python your_custom_app.py" .
# For production (without hot reload)
python your_custom_app.py
Advanced Watchfiles Configuration
You can customize watchfiles behavior according to your needs:
# Monitor only specific files
WATCHFILES_FORCE_POLLING=true watchfiles "python app.py" app.py utils.py
# Poll less often (default: every 300 ms)
WATCHFILES_FORCE_POLLING=true WATCHFILES_POLL_DELAY_MS=1000 watchfiles --filter python "python app.py" .
# Ignore specific directories
WATCHFILES_FORCE_POLLING=true watchfiles --filter python --ignore-paths "logs,__pycache__" "python app.py" .
Performance Considerations
- Development: Use hot reload for fast iteration
- Production: Disable hot reload for better performance
- Resources: Watchfiles consumes more CPU than native solutions
- Stability: In production, avoid automatic restarts that could interrupt service
Best Practices
- During development: Use entrypoints with hot reload
- Before production deploy: Switch to standard entrypoints
- For Streamlit: Prefer the native solution over watchfiles
- Monitor resources: Hot reload can increase CPU usage in environments with many files
Hot reload is a powerful tool for development, but as with any tool, use it consciously according to your application's context.
📄️ Streamlit
Creating a Streamlit Live App on MINEO is a simple and efficient way to deploy interactive web applications. Follow the steps below to set up your own Streamlit Live App:
📄️ Gradio
Creating a Gradio Live App on MINEO is an easy and effective way to deploy interactive web applications. Follow these steps to set up your own Gradio Live App:
📄️ Dash
Setting up a Dash Live App on MINEO is a hassle-free way to deploy interactive web applications. Follow these steps to create your own Dash Live App:
📄️ FastAPI
Setting up a FastAPI Live App on MINEO is an efficient way to deploy highly performant web applications. Follow the steps below to create your own FastAPI Live App:
📄️ Entrypoints and Hot Reload
Hot reload is a development technique that allows your application to automatically update when it detects changes in the source code. This is especially useful during development to speed up the iteration process, since you can edit directly your files from MINEO.
📄️ Per-User Authenticated MCP
Host an MCP server on MINEO whose tools know which user invoked them — and prove it, so no user can ever pretend to be another. MINEO attaches a short-lived, signed token to every tool call; your server checks the signature with a public key and trusts the identity inside. No popups, no shared secrets, no way for the assistant to lie about who it is.
📄️ Accessing Authenticated User Information
When you enable the login_required option in your MINEO Live App, you can access authenticated user information through HTTP headers. These headers are automatically sent to your Streamlit application when a user logs in.