Probably an unpopular opinion with everyone preferring to hand over money for convenience, but the advantage of learning to be able to do this yourself with nginx will bring a lifetime of self reliance/money saving. Yes it will take time to learn it, but the ability to spin up a super cheap digital-ocean/linode/hetzner node is a valuable skill to have in your back pocket.
Ask HN: Where to Host a FastAPI App
11–20 of 35 posts
Re: Ask HN: Where to Host a FastAPI App
#12Re: Ask HN: Where to Host a FastAPI App
#13Re: Ask HN: Where to Host a FastAPI App
#14Re: Ask HN: Where to Host a FastAPI App
#15Probably an unpopular opinion with everyone preferring to hand over money for convenience, but the advantage of learning to be able to do this yourself with nginx will bring a lifetime of self reliance/money saving. Yes it will take time to learn it, but the ability to spin up a super cheap digital-ocean/linode/hetzner node is a valuable skill to have in your back pocket.
idk it costs me like 6 dollars to run a docker container on aws's container service with .5 core. one server by hand isn't to bad, once you want to scale horizontally its going to be tedious, the tools start getting annoyingly complex. locking down everything is a headache, and theres always a nagging feeling that you didn't do it right and one well timed script from getting taken over. you also need to deal with cod…
Note, you probably shouldn't do it by hand (setting up your own servers). You'd use Ansible/Terraform.
For those that are interested but not quite ready, here's a great article [0].
Re: Ask HN: Where to Host a FastAPI App
#16Re: Ask HN: Where to Host a FastAPI App
#17Re: Ask HN: Where to Host a FastAPI App
#18I think it depends on your goals. If this is a serious project and your first deployment, consider Platform-as-a-Service (PaaS) and a managed database (DBaaS). If it's a hobby project and you're interested in learning about infrastructure you could run your app, database, and reverse proxy on a single Linux VM, which any cloud will offer. For PaaS, if you want a set-it and forget-it solution check out Render or Digit…
So, I'm currently dealing with this (like, today.) I containerized my web app. I started out with a $4 Droplet on DO. SSH'd into it, installed all the Docker stuff and cloned my repo. Could not even run npm ci with the resources available.
I kept having to resize the VM. First up to the $6 then I was running into different stuff. I ended up going up to the $24 / mo option just to get the image building. I didn't step up to every price point, because I just wanted to get the thing working, but I was really surprised at this. I don't think my Docker container is particularly resource intensive. I dialed it back to the $12 / mo option and will see how it goes.
But at least I have my whole app in a Dockerfile and the remaining infrastructure in a Docker Compose file. I like having that level of control.
Personally, my issue with PaaS is on top of being more expensive and potential vendor lock in, it often has its own little gotchas that end up not making it more convenient than the "hard way." I tried to use Digital Ocean's App Platform to build my image instead before and it was giving me Vite issues. It literally wouldn't compile even though it was compiling just fine locally and on the VM.
I think about other services like Cloudinary too. Compared to just using Sharp to do things like image transcoding. I just don't see the value there.
Overall, devops is not my area. I used to consider myself a front-end developer. But I'm glad I have been learning these skills. I don't think these "value added" services are worth the squeeze.
Re: Ask HN: Where to Host a FastAPI App
#19Re: Ask HN: Where to Host a FastAPI App
#20It uses uvicorn as recommended by the FastAPI docs.