Deploying the application

Day 10 - Deploying the application

Running locally

After making sure a Redis database is available, we start the ASGI webserver using this command

cd backend/
uvicorn api:app --host 0.0.0.0 --port 8080 --workers 4
# INFO: Uvicorn running on http://0.0.0.0:8080 (Press CTRL+C to quit)

You can choose to install redis locally or connect to Redis Cloud Enterprise if you have good internet access and want very little setup.

Running from Saturn Cloud

There are plenty of platform as a service choices to deploy this simple FastAPI web server, Heroku, Deta, AWS Elastic Beanstalk. But for this project we choose to try Saturn Cloud Deployment, the process was straightforward.

After copying our database connection secrets, we can run our server, connecting to it using SSH just like for Jupyter Notebooks.

The domain name in the form of *.community.saturnenterprise.io can be chosen. We deployed, then finally configured the HTTP client, the CLI tool we built since day 7.

https://thm-cli.community.saturnenterprise.io

References

links