ae86jack / django-realworld-example-app

把django-realworld-example-app进行docker, docker-compose

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

项目简介

django-realworld-example-app整个服务进行docker化.

项目启动

docker-compose启动, 包括前后端, 数据库等:

docker-compose up

在启动服务后, 创建表:

docker-compose exec backend python manage.py migrate

代码修改

相对原项目做了以下修改:

  • 把conduit/settings.py里的DEBUG, SECRET_KEY, DATABASES改成环境变量.
  • requirements.txt新增
    • psycopg2-binary==2.8.3
    • gunicorn==19.9.0

服务简介

  • frontend, 前端项目: http://localhost
  • db, Postgresql数据库, 初始化时新建数据库conduit, 当前设置用户名为postgres, 密码为pwd
  • pgadmin, PostgreSQL的Web管理界面: http://localhost:5050, 当前设置用户名为admin, 密码为pwd. 连接数据库, Host name/address设为db, Port5432, Usernamepostgres, Passwordpwd
  • backend, 后端项目: http://localhost/api/
  • proxy, 反向代理、负载均衡, traefik, Dashboard界面: http://localhost:8090/dashboard

About

把django-realworld-example-app进行docker, docker-compose


Languages

Language:Python 99.6%Language:Dockerfile 0.4%