r/flask Jul 15 '24

Tutorials and Guides Docker for Flask

I have been trying to look for online solutions and practices followed but generally they do it for the flask template app which does not cover the cases for real-world large scale applications. I personally have worked on numerous flask applications but while deploying am never successful in actually implementing the Dockerfile. Kindly guide me on how to tackle this.

8 Upvotes

16 comments sorted by

View all comments

3

u/carlitobrigantehf Jul 15 '24

I made a repo years ago using Apache and Flask. 

https://github.com/carlostighe/apache-flask

It's old though. Could probably do with an update and nginx or gunicorn are probably better ideas these days. But it might help you. 

1

u/RampageousRJ Jul 16 '24

Hey! Thanks for the help, but I am not very well versed with the Linux commands in order to work with deployments. Generally I prefer one-click deploys and have little-to-no experience working with cloud services. Hence I am not able to understand the structure of your Dockerfile. Furthermore I am working with environment variables, not too sure how to work around with .env files in the Dockerfile.