django-vue-admin/docker_env
李晨亮 97cde12feb fixbug:#I6BW4F (https://gitee.com/liqianglog/django-vue-admin/issues/I6BW4F)
打包Backend基础Build包时出错:#11 2.460 ERROR: Could not open requirements file: [Errno 2] No such file or directory: '/requirements.txt'
2023-01-31 11:00:37 +08:00
..
celery 功能变化: pip 替换成清华镜像源 2022-05-27 04:11:30 +08:00
django fixbug:#I6BW4F (https://gitee.com/liqianglog/django-vue-admin/issues/I6BW4F) 2023-01-31 11:00:37 +08:00
mysql 重构: 整体提交 2022-04-05 13:25:15 +08:00
nginx 新功能: nginx配置 my.conf 2022-11-25 22:33:34 +08:00
web 优化:更新运行部署方式为 gunicorn 2023-01-12 22:29:18 +08:00
README.md 重构: 整体提交 2022-04-05 13:25:15 +08:00
requirements-all.txt fixbug:#I6BVVR (https://gitee.com/liqianglog/django-vue-admin/issues/I6BVVR) 2023-01-31 10:48:17 +08:00

README.md

docker 镜像打包

打包web基础Build包

# 编译打包到本地
docker build -f ./docker_env/web/DockerfileBuild -t registry.cn-zhangjiakou.aliyuncs.com/dvadmin-pro/node12-base-web:latest .
# 上传到阿里云仓库
docker push registry.cn-zhangjiakou.aliyuncs.com/dvadmin-pro/node12-base-web:latest

打包Backend基础Build包

# 编译打包到本地
docker build -f ./docker_env/django/DockerfileBuild -t registry.cn-zhangjiakou.aliyuncs.com/dvadmin-pro/python38-base-backend:latest .
# 上传到阿里云仓库
docker push registry.cn-zhangjiakou.aliyuncs.com/dvadmin-pro/python38-base-backend:latest

运行前端

docker build -f ./docker_env/web/Dockerfile -t dvadmin-pro-web .

运行后端

docker build -f ./docker_env/django/Dockerfile -t dvadmin-pro-django .

运行celery

docker build -f ./docker_env/celery/Dockerfile -t dvadmin-pro-celery .

docker-compose 运行

# 先安装docker-compose (自行百度安装),执行此命令等待安装如有使用celery插件请打开docker-compose.yml中celery 部分注释
docker-compose up -d
# 初始化后端数据(第一次执行即可)
docker exec -ti dvadmin-django bash
python manage.py makemigrations 
python manage.py migrate
python manage.py init -y
exit

前端地址http://127.0.0.1:8080
后端地址http://127.0.0.1:8000
# 在服务器上请把127.0.0.1 换成自己公网ip
账号superadmin 密码admin123456

# docker-compose 停止
docker-compose down
#  docker-compose 重启
docker-compose restart
#  docker-compose 启动时重新进行 build
docker-compose up -d --build