Advertisement
aldikhan13

DOCKER COMPOSE RUNNER

Dec 30th, 2020
400
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.87 KB | None | 0 0
  1. @echo off
  2. title DOCKER COMPOSE RUNNER FOR WINDOWS
  3. :start
  4. cls
  5. echo off &echo.&echo off
  6. echo ===========================================================
  7. echo            DOCKER COMPOSE RUNNER FOR WINDOWS
  8. echo ===========================================================
  9. echo off &echo.&echo off
  10.  
  11. echo  1. Docker Compose Production With Build
  12. echo  2. Docker Compose Development With Build
  13. echo  3. Docker Compose Production No Build
  14. echo  4. Docker Compose Development No Build
  15. echo  5. Docker Compose Production Down
  16. echo  6. Docker Compose Development Down
  17. echo  0. Leave
  18.  
  19. echo off &echo.&echo off
  20.  
  21. choice /n /c:1234560 /m "enter your docker compose environment type ?"
  22.  
  23. if %errorlevel% equ 1 goto productionb
  24. if %errorlevel% equ 2 goto developmentb
  25. if %errorlevel% equ 3 goto productionnb
  26. if %errorlevel% equ 4 goto developmentnb
  27. if %errorlevel% equ 5 goto dockerdownprod
  28. if %errorlevel% equ 6 goto dockerdowndev
  29. if %errorlevel% equ 7 goto leavecommand
  30.  
  31. :productionb
  32. cls
  33. call docker-compose -f docker-compose.prod.yml up --build -d
  34. msg %username% "docker compose up production with build successfuly"
  35. exit
  36.  
  37. :developmentb
  38. cls
  39. call docker-compose -f docker-compose.dev.yml up --build -d
  40. msg %username% "docker compose up development with build successfuly"
  41. exit
  42.  
  43. :productionnb
  44. cls
  45. call docker-compose -f docker-compose.prod.yml up -d
  46. msg %username% "docker compose up production no build successfuly"
  47. exit
  48.  
  49. :developmentnb
  50. cls
  51. call docker-compose -f docker-compose.dev.yml up -d
  52. msg %username% "docker compose up development  no build successfuly"
  53. exit
  54.  
  55. :dockerdownprod
  56. cls
  57. call docker-compose -f docker-compose.prod.yml down
  58. msg %username% "docker compose down production successfuly"
  59. exit
  60.  
  61. :dockerdowndev
  62. cls
  63. call docker-compose -f docker-compose.dev.yml down
  64. msg %username% "docker compose down development successfuly"
  65. exit
  66.  
  67. :leavecommand
  68. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement