Skip to content

Latest commit

 

History

History
27 lines (22 loc) · 8.72 KB

README.md

File metadata and controls

27 lines (22 loc) · 8.72 KB
permalink
/index.html

Introduction

Clace is an open-source Apache-2.0 licensed project building a platform to easily develop and deploy self-hosted web applications. The main repository for Clace source code is clace. This repository has the source for Clace app template specs, which can be used as spec argument during app initialization. For example, --spec python-flask. See here for details.

App specs allow for existing applications to be used with Clace with no changes required in the application code. Pass the --spec option during app create. Clace will include the template files from the spec and bring up the application. If the spec uses containers (most do, proxy spec is the exception), then Clace will download the source code, add the template spec files, build the image and start a container with that image. API calls are automatically proxied to the application within the container.

App Specs

Spec Name Required Params Optional Params Supports Path Routing Notes Example
container
  • port : The port number within container, optional if EXPOSE directive is present
Depends on app Requires app code to have a Containerfile/Dockerfile
image
  • image: The image to use for the container
  • port : The port number within container
Depends on app No source url required when creating app, use - as url clace app create --spec image --approve --param image=nginx --param port=80 - nginxapp.localhost:/
proxy
  • url: The url to which requests should be proxied
No No source url required when creating app, use - as url clace app create --spec proxy --approve -param url=https://clace.io - proxyapp.localhost:/
static
  • index: The index file to serve
Yes All files under source folder are served clace app create --spec static --approve --param app_name="Event Planner" -param index=event-planner.html github.com/simonw/tools /event_planner
static_single
  • index: The index file to serve
Yes Only the index file is served clace app create --spec static_single --approve --param app_name="Event Planner" -param index=event-planner.html github.com/simonw/tools /event_planner
python-wsgi
  • APP_MODULE: The module:app for the WSGI app. Defaults to app:app, meaning app in app.py
Depends on app Runs 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 app Runs 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 app Runs app using flask dev server
python-streamlit
  • app_file : The file name of the streamlit app to run. Default streamlit_app.py
Yes clace 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
Yes Installs 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 app Runs app using uvicorn clace 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
Yes clace 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 app CGO is disabled; go.mod has to be present; app should bind to 0.0.0.0 clace 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