Odessa  Rice

Odessa Rice

1635412440

Scale Your Flask Applications with Nginx and Docker

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.

#nginx #docker #flask 

What is GEEK

Buddha Community

Scale Your Flask Applications with Nginx and Docker
Odessa  Rice

Odessa Rice

1635412440

Scale Your Flask Applications with Nginx and Docker

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.

#nginx #docker #flask 

Alex Tyler

Alex Tyler

1605584955

Using Nginx, uWSGI and Docker to deploy your Flask application

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

Basic Docker Compose template application with Flask, Celery, Redis, MySQL, SocketIO, Nginx and Gunicorn

Nginx / Gunicorn / Flask 🐍 / Celery / SocketIO / MySQL / Redis / Docker 🐳 sample application

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.

Requirements

Run

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

Test

pytest -v

Maintainers

@alexOarga


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 

Iliana  Welch

Iliana Welch

1595249460

Docker Explained: Docker Architecture | Docker Registries

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:

  • What is Docker Host
  • What is Docker Engine
  • Learn about Docker Architecture
  • Learn about Docker client and Docker Daemon
  • Docker Hub and Registries
  • Simple demo to understand using images from registries

#docker #docker hub #docker host #docker engine #docker architecture #api

Live: Python - Docker e Docker Compose - Projeto Flask extensions

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