Reputation: 167
I have built a fastapi API and I have a digital ocean droplet machine running on Ubuntu. I can't figure out how to deploy it to the server so that other users/machines can make use of the API. I couldn't find anything online specific to Droplets or servers regarding this, so any and all guidance will be much appreciated. I am unsure about how exactly to frame this question, so please comment if I need to provide any further clarifications. Thanks.
Upvotes: 1
Views: 5277
Reputation: 1
Fork this github and run your API as an app template it has all the settings.
https://github.com/kabuchanga/fastapi-apptst
Upvotes: 0
Reputation: 41
I'm afraid there is no simple answer. There are lots of options when it comes to deploying your application - depending on whether you need any system dependencies, whether you application is stateless or not etc.
A relatively simple and well documented way to deploy it would be to make use of Docker and Digital Oceans' App Platform.
The steps are:
Create > App
There are, of course, other options. Since you've mentioned that you already have a DO droplet ready, you could run the container there easily. The solution I provided is just one of your options. Additionaly, if you need things like a database, a caching solution like Redis etc., you might find settings things up yourself more cost-effective. Especially since it sounds like you're new to this and your app isn't a very large project. Most importantly, don't let this answer scare you from setting up your deployment yourself on your droplet - that definitely is also a very viable solution.
Upvotes: 2