Git Product home page Git Product logo

docker-django-mysql-celery's Introduction

docker-django-mysql-celery

docker-compose project with mysql as db, redis as cache, django as web, celery as task queue, haproxy as load balance tool

English Doc

依赖

Docker, Docker Compose

如何开始

克隆项目

git clone https://github.com/aishenghuomeidaoli/docker-django-mysql-celery.git

cd docker-django-mysql-celery

初始化MySQL

这里会创建一个MySQL数据库,方便Django服务端连接。

如果你有一个远程的MySQL服务器,请跳过此处,在Django配置文件中修改数据库地址。

查看容器化MySQL的原因

docker-compose -f docker-compose-mysql.yaml up -d

mysql -u root -h 0.0.0.0 -p

执行SQL,创建数据库,修改时区。

CREATE DATABASE mydb CHARACTER SET utf8 COLLATE utf8_general_ci;
SET time_zone = 'Asia/Shanghai';

启动项目

这里会为 mysql、web、redis、haproxy创建容器。

docker-compose up -d

因为Haproxy的存在,可以开启多个web容器,支持负载均衡。

docker-compose up -d --scale web=2

访问页面

打开浏览器,访问 http://0.0.0.0/ ,创建一个运算任务、任务执行结束后,页面会刷新任务列表。

删除所有容器

docker-compose down

docker-django-mysql-celery's People

Contributors

aishenghuomeidaoli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 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.