This is a template app built with DBOS and FastAPI.
To get started building, edit app/main.py
.
Then, commit your changes and visit the cloud console to redeploy it from GitHub!
To include new packages or dependencies, add them to requirements.txt
.
Deploying via the DBOS Cloud CLI
You can also deploy this app via the DBOS Cloud CLI. Install it with this command (requires Node):
npm i -g @dbos-inc/dbos-cloud
Then, run this command to deploy your app:
dbos-cloud app deploy
To run this app locally, you need to connect it to a Postgres database. You can use a DBOS Cloud database, a Docker container, or a local Postgres installation.
Connecting to a DBOS Cloud Postgres database
First install the DBOS Cloud CLI (requires Node):
npm i -g @dbos-inc/dbos-cloud
Then set a password for your DBOS Cloud database:
dbos-cloud db reset-password
Then connect your local app to your cloud database. When prompted, enter the password you just set.
dbos-cloud db local
Starting Postgres with Docker
If you have Docker, you can start a Postgres database locally with:
export PGPASSWORD=dbos
python3 start_postgres_docker.py
After connecting to Postgres, create a virtual environment and install dependencies:
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
Then start your app:
dbos start
Visit http://localhost:8000
to see your app!