1635412440
In this video, I show you how you can scale your Flask applications with multiple application servers, and use Nginx to load balance it and distribute it's traffic. I will be using Docker for all of this as it is very easy to manage as well as scale.
1635412440
In this video, I show you how you can scale your Flask applications with multiple application servers, and use Nginx to load balance it and distribute it's traffic. I will be using Docker for all of this as it is very easy to manage as well as scale.
1605584955
You have successfully built that flask application and you plan on deploying to a server but you have no idea how or ways to go about it. In this article, I will walk you through on how you can containerize your flask application using Docker, uWSGI and Nginx.
Here’s a simple flask application which contains basic HTML and CSS files.
.
└── app
├── main.py
├── requirements.txt
├── static
│ └── css
│ └── template.css
├── templates
│ ├── about.html
│ ├── home.html
│ └── template.html
└── uwsgi.ini
4 directories, 7 files
Navigate to the app directory and create a uwsgi.ini file and add the following code
[uwsgi]
module = main
callable = app
What uwsgi.ini file does is that it communicates with the python web server when requests are being sent to uwsgi.
After that, navigate to the main directory and create an **entrypoint.sh **file.
#docker #flask #nginx
1642125651
Basic Docker Compose template application for orchestating Flask with a Celery queue task, Redis message broker, MySQL database and support for SocketIO protocol.
Deployed with Nginx server and Gunicorn WSGI.
Flower supervision of Celery workers is also available. SocketIO is implemented through Flask-SocketIO.
Note that this application is almost production-ready. To see a production-ready application that follows this template check out CONTRABASS-webservices.
This template is intended for asynchronous tasks, periodical tasks and apps that require asynchronous communication through WebSockets-like protocols. Note that this makes an ideal backend for long-time execution web apps.
Notice that this application is horizontally scalable as it allows replication through multiple nginx, gunicorn, and celery workers.
First setup variables on .docker.env
. Assuming you have Docker and docker-compose installed, run on terminal:
docker-compose up
In order to bring it down run:
docker-compose down
Go too:
http://127.0.0.1/hello/MyApplicationExample
Flower management page
pytest -v
Author: alexOarga
Source Code: https://github.com/alexOarga/docker-nginx-flask-celery-mysql-redis
License: MIT License
#flask #celery #redis #mysql #socketio #nginx #gunicorn #docker
1595249460
Following the second video about Docker basics, in this video, I explain Docker architecture and explain the different building blocks of the docker engine; docker client, API, Docker Daemon. I also explain what a docker registry is and I finish the video with a demo explaining and illustrating how to use Docker hub
In this video lesson you will learn:
#docker #docker hub #docker host #docker engine #docker architecture #api
1591254714
Neste episódio colocamos o serviço #python para rodar com #Docker e Docker compose e o próximo passo será a #api Multistreaming with https://restream.io/?ref…
#python #docker compose #docker #projeto flask #flask