DEV Community

loading...

Ready to deploy! Vue + Flask, but where to deploy it to?

Daniel da Rocha
architect turned dev
・1 min read

Hi all!

After some weeks toiling with my app, I would love to finally deploy it to a production server. The thing is built as follows:

  • Backend: Python Flask + Postgresql as an API endpoint
  • Frontend: Vue.js SPA with axios calls to my API to populate data

So where would you put something like this? I am thinking, Heroku or Digital Ocean? Or not? Any advice on what should I watch out for?

As much as the idea of a static site is appealing (using nuxt.js or VuePress), it would not work for me, as I have a lot of relational data that might be displayed by the user in unpredictable ways. Also, there will be a user account system on v2.0, so I guess this disqualifies the site for Netlify, right?

Thanks a lot!
Best,
Daniel

Discussion (7)

Collapse
ben profile image
Ben Halpern

Heroku or Digital Ocean?

Why not both? I think that would make for a pretty great exercise. Neither would be so time consuming or painful that it wouldn't be worth it (and if one is, then you might just have your answer)

Would be a great apples-to-apples comparison you could take with you. It would also make for a great dev.to post. πŸ˜‰

Collapse
danroc profile image
Daniel da Rocha Author

haha sounds like a plan! :)

Collapse
danroc profile image
Daniel da Rocha Author

Alright, after a while building up everything on Heroku, I have come to realize its limitations and why DigitalOcean might be a more interesting alternative, despite being more complex.

Some considerations:

  • Heroku does have free tiers but their limitations can become annoying. One of them is the sleeping app issue (which has workarounds, yes, but annoying nonetheless). The other is the free tier of Postgresql with a maximum of 10,000 lines, which in the beginning sounded like a lot, but now I am almost reaching that limit!
  • And that's where things start to get expensive. As I have to upgrade each app separately, plus the Postgresql upgrade, I am looking at a bill of around 20$/month just to go up to their most basic free level

Then I took a second look on DO, and I realized I only needed one droplet (initially), in which I could run both the Flask API and the Vue app and manage my own Postgresql db without Heroku's limits. And that would all cost me 5$/month for the cheapest droplet.

So I am now in the process of setting up a droplet on DO to try and run my apps from there.

However, some questions:

  • Will I really be able to run all my apps there? And maybe even in the future a Graphql server (in case I want to ditch my FlaskRESTful api sometime in the future)?

  • How far will the cheapest droplet take me??

Anyway, just thought I'd share!
Best,
Daniel

Collapse
danroc profile image
Daniel da Rocha Author

Quick follow-up. I gave up on Digital Ocean quite quickly, for two reasons:

  1. No free tier to try things out; I ended up buying $5 of credit but ended up not using because...

  2. ...it was all a bit too cryptic for me, especially coming from Heroku. From having to choose which operating system to install on my droplet and the lack of a straightforward "deploy Flask to Digital Ocean" tutorial (there seems to be one tutorial for each possible droplet configuration!), it was all too overwhelming while Heroku was such a breeze.

So I am quite happy for now with Heroku. Flask API deployed, AWS S3 configured to host my static files, and in the process of deploying my Vue frontend.

Collapse
danroc profile image
Daniel da Rocha Author

Just deployed the backend to Heroku. I have to say it was much easier than expected. On to try Digital Ocean next!

Collapse
armishsonkar profile image
armishsonkar

Hey Daniel, can you give us an update on how your Vue+Flask applications are doing on Heroku ? I am trying to make a decision to deploy my Vue+Flask+ Postgresql app with my custom domain name
Thanks

Collapse
danroc profile image
Daniel da Rocha Author • Edited

Hey Armush,

I've long departed from this setup with Flask...
Now it is Vue + Postgraphile, and I deploy FE to Netlify and BE to DigitalOcean using Dokku...

Sorry I cannot help!! :/