Giter Club home page Giter Club logo

flask-docker-celery-rabbitmq's Introduction

flask-docker-celery-rabbitmq

This repository is for running a simple dummy flask application in a docker environment.

It uses:

  • Flask
  • Celery
  • Flower
  • Rabbitmq
  • PostgreSQL (not doing anything, though)

Prerequisites

Make sure you have docker and docker-compose installed.

Running

Clone this repository and navigate into it in your terminal. Run in development mode, so set APP_ENV environment to Dev

APP_ENV=Dev docker-compose up --build

It will expose 2 ports, one for the flask application (8888) and one for the RabbitMQ management interface (15672). It will also start 2 worker containers.

When it runs, you can test it with several curl posts request and check it running in the Flower interface.

for value in {1..50}
do
    curl --data '{json}' -H 'Content-Type: application/json' 0.0.0.0:8888/api/process_data
done

This will run 50 tasks, you can see in the flower http://localhost:5556 how the tasks are distributed between the worker instances.

You can also check the status of a specific task in flask: http://localhost:8888/api/tasks/<task-id>

The RabbitMQ interface http://localhost:15673 with login:

  • username: rabbit_user
  • password: rabbit_password

flask-docker-celery-rabbitmq's People

Contributors

duikboot avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.