📌 Explore end-to-end configuration examples in the use-cases section.

App Specs

App Specs

OpenRun app specs are defined at https://github.com/openrundev/appspecs.

The image spec specifies the image to use. for example

openrun app create --spec image --approve --param image=nginx \
  --param port=80 - nginxapp.localhost:/

downloads the nginx image, starts it and proxies any request to https://nginxapp.localhost:25223 to the nginx container’s port 80. The container is started on the first API call, and it is stopped automatically when there are no API calls for 180 seconds.

For most other specs, the Containerfile is defined in the spec. For example, for the python-streamlit spec, the Containerfile is here. Running

openrun app create --spec python-streamlit --branch master \
  --approve github.com/streamlit/streamlit-example /streamlit_app

will create an app at https://localhost:25223/streamlit_app. On the first API call to the app, the image is built from the defined spec and the container is started. The python-gradio spec does the same for gradio apps.

The container spec is a generic spec which can be used when there is a Dockerfile defined in tha app source code.

App Specs Listing

The specs defined currently are:

Spec NameRequired ParamsOptional ParamsSupports Path RoutingNotesExample
container
  • port : The port number within container, optional if EXPOSE directive is present
Depends on appRequires app code to have a Containerfile/Dockerfile
image
  • image: The image to use for the container
  • port : The port number within container
Depends on appNo source url required when creating app, use - as urlopenrun app create --spec image --approve --param image=nginx --param port=80 - nginxapp.localhost:/
proxy
  • url: The url to which requests should be proxied
NoNo source url required when creating app, use - as urlopenrun app create --spec proxy --approve -param url=https://openrun.dev - proxyapp.localhost:/
python-wsgi
  • APP_MODULE: The module:app for the WSGI app. Defaults to app:app, meaning app in app.py
Depends on appRuns Web Server Gateway Interface (WSGI) apps using gunicorn
python-asgi
  • APP_MODULE: The module:app for the ASGI app. Defaults to app:app, meaning app in app.py
Depends on appRuns Asynchronous Server Gateway Interface (ASGI) apps using uvicorn
python-flask
  • port : The port number within container. If EXPOSE directive is present, that is used. Defaults to 5000
Depends on appRuns app using flask dev server
python-streamlit
  • app_file : The file name of the streamlit app to run. Default streamlit_app.py
Yesopenrun app create --spec python-streamlit --branch master --approve github.com/streamlit/streamlit-example /streamlit_app
python-streamlit-poetry
  • app_file : The file name of the streamlit app to run. Default streamlit_app.py
YesInstalls packages using poetry
python-fasthtml
  • APP_MODULE: The module:app for the ASGI app. Defaults to app:app, meaning app in app.py
Depends on appRuns app using uvicornopenrun app create --approve --spec python-fasthtml --param APP_MODULE=basic_ws:app https://github.com/AnswerDotAI/fasthtml/examples fasthtmlapp.localhost:/
python-gradio
  • app_file : The file name of the gradio app to run. Default run.py
Yesopenrun app create --spec python-gradio --approve github.com/gradio-app/gradio/demo/blocks_flag /gradio_app
go
  • port : The port number within container
  • MAIN_PACKAGE : The go module to build, default “.”. Pass as a --carg instead of --param.
  • APP_ARGS : Args to pass to the app
Depends on appCGO is disabled; go.mod has to be present; app should bind to 0.0.0.0openrun app create --approve --spec go --param port=8080 --param APP_ARGS="-addr 0.0.0.0:8080" --branch master github.com/golang/example/helloserver /goapp