README-usage.bash 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. ## USAGE
  2. # 一、构建操作
  3. # 构建启动
  4. echo "BEGIN:" \
  5. && project_path="/home/server/repositories/repositories/casperz.py-project/project-fastapi-bg" \
  6. && cd ${project_path} \
  7. && sudo docker-compose --file compose.yml down \
  8. && sudo docker-compose --file compose.yml up --detach --build \
  9. && sudo docker-compose --file compose.yml logs --follow
  10. # 调试
  11. echo "BEGIN:" \
  12. && project_path="/home/server/repositories/repositories/casperz.py-project/project-fastapi-bg" \
  13. && cd ${project_path} \
  14. && sudo docker-compose --file compose.yml down \
  15. && sudo docker-compose --file compose.yml up --detach --build \
  16. && sudo docker exec -it sri_module_agent_001 bash
  17. # 强制构建并运行
  18. echo "BEGIN:" \
  19. && project_path="/home/server/repositories/repositories/casperz.py-project/project-fastapi-bg" \
  20. && cd ${project_path} \
  21. && sudo docker-compose --file compose.yml down \
  22. && sudo docker-compose --file compose.yml build --no-cache \
  23. && sudo docker-compose --file compose.yml up --detach \
  24. && sudo docker-compose --file compose.yml logs --follow
  25. # 重启
  26. echo "BEGIN:" \
  27. && project_path="/home/server/repositories/repositories/casperz.py-project/project-fastapi-bg" \
  28. && cd ${project_path} \
  29. && sudo docker-compose --file compose.yml down \
  30. && sudo docker-compose --file compose.yml up --detach \
  31. && sudo docker-compose --file compose.yml logs --follow
  32. # 二、日常调试命令
  33. sudo chmod -R 777 /home/ubuntu/repositories/repositories
  34. sudo chmod -R 777 /home/server/repositories/repositories
  35. sudo docker restart sri-module-bg01 && sudo docker logs -f sri-module-bg01