You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@ This project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
10
10
### Added
11
11
12
12
- Added the app code setting `container.separate_stage_prod_images` for specs that need distinct staging and production container images.
13
+
- Added the `static_disk` app spec for serving static files directly from a local source directory without storing the static file contents in the metadata database.
Copy file name to clipboardExpand all lines: docs/content/docs/Container/AppSpecs.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,15 @@ will create an app at `https://localhost:25223/streamlit_app`. On the first API
28
28
29
29
The `container` spec is a generic spec which can be used when there is a `Dockerfile` defined in tha app source code.
30
30
31
+
The `static` specs serve files from the app source. The `static` and `static_single` specs load source files into the metadata database like other non-dev disk apps. The `static_disk` spec is for local-disk sources only: OpenRun stores the spec metadata, but static files are served directly from the source directory on disk and are not copied into the metadata database. Updating a served file on disk takes effect on the next request. App reload is still required when app metadata or app definition behavior changes, such as changing the selected spec, `app.star`, `params.star`, `index`, or `single_file`.
On Kubernetes, a network mounted disk path should be used for the `static_disk` source path so that files are visible from all pods.
39
+
31
40
By default, staging and production apps generated from the same source share the same generated container image when the build inputs match. App specs should keep app path and domain values out of image builds when possible, and read runtime values such as `CL_APP_PATH` and `CL_APP_URL` from the container environment instead. If a spec must embed staging or production URL information into the image during build, set `container.separate_stage_prod_images` in the spec's `app.star`:
32
41
33
42
```python {filename="app.star"}
@@ -48,6 +57,9 @@ The specs defined currently are:
48
57
| container || <ul><li><b>port</b> : The port number within container, optional if EXPOSE directive is present</li></ul> | Depends on app | Requires app code to have a Containerfile/Dockerfile |
49
58
| image | <ul><li><b>image</b>: The image to use for the container</li> <li><b>port</b> : The port number within container</li></ul> || Depends on app | No source url required when creating app, use - as url |`openrun app create --spec image --approve --param image=nginx --param port=80 - nginxapp.localhost:/`|
50
59
| proxy | <ul><li><b>url</b>: The url to which requests should be proxied</li> </ul> || No | No source url required when creating app, use - as url |`openrun app create --spec proxy --approve -param url=https://openrun.dev - proxyapp.localhost:/`|
60
+
| static || <ul><li><b>index</b>: The index file to serve</li><li><b>single_file</b>: Serve only the index file</li></ul> | Yes | All files under source folder are served from metadata |`openrun app create --spec static --approve --param index=index.html github.com/example/site /site`|
61
+
| static_single || <ul><li><b>index</b>: The index file to serve</li></ul> | Yes | Only the index file is served from metadata |`openrun app create --spec static_single --approve --param index=index.html github.com/example/site /site`|
62
+
| static_disk || <ul><li><b>index</b>: The index file to serve</li><li><b>single_file</b>: Serve only the index file</li></ul> | Yes | Local disk source only; files are served directly from disk |`openrun app create --spec static_disk --approve --param index=index.html /srv/sites/my-static-site /site`|
51
63
| python-wsgi || <ul><li><b>APP_MODULE</b>: The module:app for the WSGI app. Defaults to app:app, meaning app in app.py</li> </ul> | Depends on app | Runs Web Server Gateway Interface (WSGI) apps using gunicorn |
52
64
| python-asgi || <ul><li><b>APP_MODULE</b>: The module:app for the ASGI app. Defaults to app:app, meaning app in app.py</li> </ul> | Depends on app | Runs Asynchronous Server Gateway Interface (ASGI) apps using uvicorn |
53
65
| python-flask || <ul><li><b>port</b> : The port number within container. If EXPOSE directive is present, that is used. Defaults to 5000</li></ul> | Depends on app | Runs app using flask dev server |
0 commit comments