当前位置: 首页 > 软件库 > Web应用开发 > Web框架 >

docker-flask-celery-redis

授权协议 Readme
开发语言 Python
所属分类 Web应用开发、 Web框架
软件类型 开源软件
地区 不详
投 递 者 白驰
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Docker Flask Celery Redis

A basic Docker Compose template for orchestrating a Flask application & a Celery queue with Redis

Installation

git clone https://github.com/mattkohl/docker-flask-celery-redis

Build & Launch

docker-compose up -d --build

Enable hot code reload

docker-compose -f docker-compose.yml -f docker-compose.development.yml up --build

This will expose the Flask application's endpoints on port 5001 as well as a Flower server for monitoring workers on port 5555

To add more workers:

docker-compose up -d --scale worker=5 --no-recreate

To shut down:

docker-compose down

To change the endpoints, update the code in api/app.py

Task changes should happen in celery-queue/tasks.py


adapted from https://github.com/itsrifat/flask-celery-docker-scale

  • 简单来说, docker compose就是一键启动/关闭多个容器的工具, 它能够帮你解决容器之间依赖的问题, 哪个先启动, 依赖哪个容器等. 当开发的系统越来越复杂, 开发环境和部署都没那么简单的时候, 可以试试docker compose. 下面会把我实际经验中的一个例子简化出来,一步步教大家如何搭建docker compose,对踩过的坑进行总结,希望对docker能有更深的了解. 1. 搭

  • 导语 flask非常灵活,也非常难以驾驭,如何把flask同日常使用的功能结合起来,是需要考虑的问题,这里提供了一些方案 完整的docker+docker-compose+ci/cd流程 一键部署热更新代码到云主机 flask cli 通过FlaskGroup来管理所有commands,运行脚本 flask factory模式 结合celery 创建异步任务队列 flask+redis 配置缓存

  • Flask celery实现发送定时任务 开启的条件 Flask celery发送定时任务时,要同时开启redis数据库,celery worker还有celerybeat, 要开多个终端 Redis数据库开启方法: 配置文件开启法(我的):sudo redis-server /etc/redis/redis.conf Celery worker开启命令:$ celery -A 项目名 worke

  • # --------------------------------------------------------- # 主扫描任务 # --------------------------------------------------------- @dockerSec.task(bind=True) def scan_task(self, ImageName): pull = "

 相关资料
  • 后台运行任务的话题是有些复杂,因为围绕这个话题会让人产生困惑。为了简单起见,在以前我所有的例子中,我都是在线程中执行后台任务,但是我一直注意到更具有扩展性以及具备生产解决方案的任务队列像 Celery 应该可以替代线程中执行后台任务。 不断有读者问我关于 Celery 问题,以及怎样在 Flask 应用中使用它,因此今天我将会向你们展示两个例子,我希望能够覆盖大部分的应用需求。 什么是 Celer

  • 问题内容: 我真的很难为Flask,SQLAlchemy和Celery设置正确的设置。我进行了广泛的搜索并尝试了不同的方法,但似乎没有任何效果。我错过了应用程序上下文,或者无法运行工作程序,或者还有其他问题。该结构非常通用,因此我可以构建一个更大的应用程序。 我正在使用:Flask 0.10.1,SQLAlchemy 1.0,Celery 3.1.13,我当前的设置如下: app / init.p

  • An example Flask + Docker app You could use this example app as a base for your new project or as a guide toDockerize your existing Flask app. The example app is minimal but it wires up a number of th

  • Dockerizing Flask with Postgres, Gunicorn, and Nginx Want to learn how to build this? Check out the post. Want to use this project? Development Uses the default Flask development server. Rename .env.d

  • Supported tags and respective Dockerfile links python3.9, latest (Dockerfile) python3.8, (Dockerfile) python3.7, (Dockerfile) python3.6 (Dockerfile) Discouraged tags python3.9-alpine3.13 (Dockerfile)

  • Supported tags and respective Dockerfile links python3.9, latest (Dockerfile) python3.8, (Dockerfile) python3.7, (Dockerfile) python3.6 (Dockerfile) Discouraged tags python3.8-alpine (Dockerfile) To l