Live data from Hacker News

Ask HN: Where to Host a FastAPI App

news.ycombinator.com

11–20 of 35 posts

Re: Ask HN: Where to Host a FastAPI App

#11
post #5

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.

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 code deploys. just dumping the python code in a docker container and uploading it is easy. updating a hand set up server, again is tedious and error prone.

Re: Ask HN: Where to Host a FastAPI App

#12
PythonAnywhere founder here: your timing is impeccable! Literally today we started our beta-testing of our initial implementation of ASGI support. Features are limited right now but you can start and run a FastAPI site with a single request to the API -- no UI yet, but we decided to release the backend while we were working on the frontend so that people could give the tires a kick ASAP. If you're interested, drop us a line at the usual support address and I'm sure we can on-board you if it does what you need.

Re: Ask HN: Where to Host a FastAPI App

#15
post #11
post #5

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.

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…

Sure it's not for everyone. I learnt a lot doing cash strapped startups where there wasn't a devops person. AWS can get expensive, especially when you start using more and more services (lambda,dynamodb,rds,elasticache etc) although it can be easily scaled.

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].

[0] https://github.com/fpereiro/backendlore.

Re: Ask HN: Where to Host a FastAPI App

#18
post #9

I 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…

>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.

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.

Post reply on HN