/docker-nginx-flask-celery-mysql-redis

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

Primary LanguagePythonMIT LicenseMIT

GitHub license

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 to:

Test

pytest -v

Maintainers

@alexOarga