0.0.0.0, port 8888. Each section below gives one framework’s packages, App code, and entry point. Use it in the Write the entry point step of Develop and test. Previewing, publishing, and deploying work the same way for every framework.
Choose a framework
For a JavaScript front end such as React, ask a coding assistant to scaffold the App with the domino-app-init Domino Skill. Size and scale an App covers the performance settings in the table.
Before you begin
The Project’s Compute Environment must include the framework. To add a Python package, open the environment under Govern > Environments, select Edit Definition, add the install to the Dockerfile, and select Build. For example, for Dash:DOMINO_RUN_HOST_PATH. Domino sets this variable at startup to the URL path it serves the App under.
Dash
Dash builds interactive analytic Apps on Plotly visualizations. Installdash in the Compute Environment.
routes_pathname_prefix='/' and requests_pathname_prefix from DOMINO_RUN_HOST_PATH let Dash load its assets and callbacks behind the Domino proxy. The Dash Gallery has layouts to adapt.
Streamlit
Streamlit turns a Python script into a web App. Domino Standard Environments include Streamlit. Streamlit serves on port8501 by default, so the entry point writes a Streamlit configuration file that sets port 8888 and host 0.0.0.0 before it starts the App.
DOMINO_RUN_HOST_PATH.
Example: chatbot
Domino’s Streamlit chatbot example sends prompts to large language models (LLMs) hosted on Hugging Face or to a Domino endpoint. To run it:- Add your Hugging Face access token as a user environment variable named
HUGGING_FACE_API_TOKEN. - Install
streamlit,requests,pandas,transformers, andtorchin the Compute Environment. - Copy
chatbot.pyfrom the example into your Project. Set the endpoint’s URL and access token as Project environment variables, such asMODEL_ENDPOINT_URLandMODEL_ACCESS_TOKEN, and read them inchatbot.py. Select Domino endpoint authorization mode explains endpoint tokens. - Use the
app.shabove withstreamlit run chatbot.pyas its last line.
Flask
Flask suits custom endpoints and bespoke web Apps. Flask works with Domino routing and identity headers without extra configuration.Structure a larger Flask App
For an App with templates and static files, make the App a Python package. The names__init__.py, static, and templates are required. Flask looks for static files and templates in those folders.
__init__.py creates the App and wraps it so that the URLs Flask builds include the path Domino serves the App under:
flask_app/__init__.py
views.py holds the App’s routes. run.py imports both, and app.sh starts Flask on the required host and port:
Shiny
Shiny is R’s framework for reactive web Apps. This two-file App draws the Telephones by region chart from R’s built-inWorldPhones data. Shiny requires the files to be named server.R and ui.R.
app.sh is the entry point. Identity headers reach a Shiny App only through Shiny Server Pro. Autoscale a Shiny App to serve any number of viewers; see R and Shiny.
Rust
Rust suits Apps where latency, throughput, or correctness matter more than iteration speed. A Rust App is a compiled web server, for example built with axum. Build it once in a Workspace or Job with a pinned toolchain, keep the binary in/mnt/artifacts in a Git-based Project so each App version pins it with the commit, and have app.sh run the binary without compiling.
href="static/app.css" and fetch("api/data"). Where a value must be absolute, read the prefix from DOMINO_RUN_HOST_PATH. Build on the App’s Hardware Tier, so the binary matches the node’s CPU.
The domino-rust-apps Domino Skill does the rest. It installs the pinned toolchain in the Compute Environment, scaffolds the Project with lint and release profiles, builds dated binaries, writes an app.sh that checks the binary against the committed sources, and covers viewer identity, Postgres, and corporate certificates, proxies, and package mirrors.
Static HTML
Python’s built-in HTTP server servesindex.html and any other static files in the Project. Select app.py as the App file.
app.py
Next steps
- Commit your changes, because App Preview runs the latest commit.
- Run the App in App Preview with your entry point as the App file.
- Publish a version, then deploy it.