A12Studios / semantle-es

Source code for "Semantle en español"
http://semantle-es.cgk.cl
GNU General Public License v3.0
3 stars 0 forks source link

replace flask dev web server #3

Open cgallegu opened 2 years ago

cgallegu commented 2 years ago

It's not recommended to use Flask's dev web server in production.

Replace it with a proper one.

cgallegu commented 2 years ago

Let's decide which one before rolling it out.

jurelmetal commented 2 years ago

Depends on the infra solution. Right now with a plain VM we can choose whatever we like, but in managed infra we may have restrictions on this. May have to look into running the app as a lambda function instead of a web server.

cgallegu commented 2 years ago

One thing to consider when evaluating going serverless is how that'll work with the sqlite db. Will the function pull the whole thing on each coldstart? It's big (> 1GB), so that might take a while, or might increase costs.

I haven't tried it or investigated it. I like lambda because the cost scales with the number of players which is cool when there's only a few. I'm also happy not operating a host if I can do that, as long as it's not way more expensive than the current setup.

On Wed, Feb 23, 2022 at 10:44 AM jurelmetal @.***> wrote:

Depends on the infra solution. Right now with a plain VM we can choose whatever we like, but in managed infra we may have restrictions on this. May have to look into running the app as a lambda function instead of a web server.

— Reply to this email directly, view it on GitHub https://github.com/cgallegu/semantle-es/issues/3#issuecomment-1048919898, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHP4YJ5MXNNEA4WBRIHBC3U4T6ENANCNFSM5PEOSKBQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

cgallegu commented 2 years ago

If using a host, gunicorn + flask as per the docs: https://docs.gunicorn.org/en/latest/custom.html

cgallegu commented 2 years ago

The API is built on Flask. Flask uses Werkzeug. So let's start from the docs.

cgallegu commented 2 years ago

Flask also has Deployment Options in the docs.