Upload WindowsDeploy.bat
Browse files- WindowsDeploy.bat +19 -2
WindowsDeploy.bat
CHANGED
@@ -7,6 +7,23 @@ set PORT=12315
|
|
7 |
set DIRECTORY_PATH=/root/SaprotHub/local_server
|
8 |
set IMAGE_TAG=saprothub_image
|
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
:: Check if Docker image exists
|
11 |
echo Checking if Docker image exists...
|
12 |
docker images | findstr %IMAGE_TAG% >nul
|
@@ -27,7 +44,7 @@ echo Checking if Docker container exists...
|
|
27 |
docker ps -a | findstr %CONTAINER_NAME% >nul
|
28 |
if errorlevel 1 (
|
29 |
echo The container does not exist, creating and starting the container...
|
30 |
-
docker run -d --name %CONTAINER_NAME%
|
31 |
if errorlevel 1 (
|
32 |
echo Failed to create and start Docker container.
|
33 |
pause
|
@@ -56,4 +73,4 @@ echo Now inside the Docker container. Run the following commands manually:
|
|
56 |
echo chmod +x %DIRECTORY_PATH%/run.sh
|
57 |
echo cd %DIRECTORY_PATH%
|
58 |
echo ./run.sh
|
59 |
-
pause
|
|
|
7 |
set DIRECTORY_PATH=/root/SaprotHub/local_server
|
8 |
set IMAGE_TAG=saprothub_image
|
9 |
|
10 |
+
:: Check if Docker is installed
|
11 |
+
where docker >nul 2>nul
|
12 |
+
if %errorlevel% neq 0 (
|
13 |
+
echo Docker is not installed. Please install Docker Desktop first.
|
14 |
+
pause
|
15 |
+
exit /b
|
16 |
+
)
|
17 |
+
|
18 |
+
:waitForDocker
|
19 |
+
echo Checking if Docker is ready...
|
20 |
+
docker info >nul 2>nul
|
21 |
+
if %errorlevel% neq 0 (
|
22 |
+
echo Docker is not running. Please start Docker Desktop.
|
23 |
+
pause
|
24 |
+
exit /b
|
25 |
+
)
|
26 |
+
|
27 |
:: Check if Docker image exists
|
28 |
echo Checking if Docker image exists...
|
29 |
docker images | findstr %IMAGE_TAG% >nul
|
|
|
44 |
docker ps -a | findstr %CONTAINER_NAME% >nul
|
45 |
if errorlevel 1 (
|
46 |
echo The container does not exist, creating and starting the container...
|
47 |
+
docker run -d --name %CONTAINER_NAME% -p %PORT%:12315 %IMAGE_TAG% /bin/bash -c "while true; do sleep 1000; done"
|
48 |
if errorlevel 1 (
|
49 |
echo Failed to create and start Docker container.
|
50 |
pause
|
|
|
73 |
echo chmod +x %DIRECTORY_PATH%/run.sh
|
74 |
echo cd %DIRECTORY_PATH%
|
75 |
echo ./run.sh
|
76 |
+
pause
|