Deploying FastAPI on DigitalOcean (or really any Linux server!)
In this section, we are going to take our simple analytics application and deploy it on a Ubuntu server on DigitalOcean (www.digitalocean.com) as an Asynchronous Server Gateway Interface (ASGI) application. We are going to end up with a pretty robust and customizable setup that includes our development web server – Uvicorn – but also Gunicorn (https://gunicorn.org), an excellent and robust web server that plays very nicely with Nginx, and a virtual machine running Ubuntu – a DigitalOcean droplet. Though in this example we are going to use DigitalOcean, the procedure should apply to any Debian or Ubuntu-based setup; you can try it out on your own machine running Ubuntu. The following instructions rely heavily on the excellent tutorials on setting up an Ubuntu server on DigitalOcean by Brian Boucheron (https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-20-04) and on deploying...