#🔒 where can I deploy my fastapi ?

7 messages · Page 1 of 1 (latest)

soft mica
#

Requirements:

  1. Reliable / production-ready that wouldn’t break down randomly.
  2. Had a CLI to quickly deploy my FastAPI.
  3. A free tier so my clients can use the app free of charge to test out their idea fully, and only if they want to expand, they go to a higher plan / fixed plan, as my preference was to know exactly what to pay.
  4. Not have to put my card.
  5. Don’t need a Docker file or GitHub repo to deploy.

When I came to know about Vercel, I literally jumped with happiness because it was so easy to deploy. It had a free tier and fixed pricing per user, so cost was predictable, and it was production-ready. I was so happy about it...

...Until today. I was trying to add New Relic to my app, and I was very familiar with the lifecycle state and startup-shutdown event. So, I thought that I should initiate my relic in startup where I will also open my database connection and close the relic and DB in shutdown. Until then, I had been testing in localhost, but I thought, okay, it works on localhost, let’s see if it works on Vercel too because until this point, I was only hitting FastAPI endpoints and getting data, and it was working flawlessly. It was until I tried using the lifecycle state that I came to realize that Vercel does not trigger startup and shutdown, nor does it trigger middleware. The two things necessary for handling big apps were gone.

Vercel deployed my app as a serverless function, and every time I hit the endpoint, it would spin up the app, which is why those two things weren’t working. I found this problem 5 hours ago.

And I still haven’t found a solution. I honestly feel so demotivated. I wrote in FastAPI Reddit, and I got to know about:

  • Render (discarded because it required a card).
  • Flyio (discarded because it required a card).
  • Koyeb (requires GitHub repo).
  • And many others.

Is there any deployment that fulfills all my requirements above and also works with FastAPI lifecycle state and middlewares?

pastel ospreyBOT
#

@soft mica

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

vast forge
#

The card thing, I can understand. But not allowing a github repo is not a great requirement.
Also, in short, if you don't want serverless, will need a VPS and there are no free ones. They are not very expensive. But they do require a card. I have not heard of koyeb, but if the only thing is that it requires github, I would look into it and try to use that

#

Actually, I just looked them up. It is also serverless

#

So yea, basically, your option is to do local hosting. But that is not a great solution for many different reasons.
There isn't really a 1) Reliable and 3) Free option out there.

I am also a little confused about what you want to do. Do you want people to deploy your app? Or are they connecting to your app?

pastel ospreyBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.