-
Notifications
You must be signed in to change notification settings - Fork 0
/
runDocker.bat
69 lines (58 loc) · 1.53 KB
/
runDocker.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
@echo off
setlocal enabledelayedexpansion
where docker >nul 2>nul
if %errorlevel% neq 0 (
echo Docker is not installed! Please install Docker Desktop first.
echo Download from: https://www.docker.com/products/docker-desktop
pause
exit /b 1
)
docker info >nul 2>nul
if %errorlevel% neq 0 (
echo Docker service is not running! Please start Docker Desktop.
echo If Docker Desktop is not started, please launch it and wait until it's ready.
pause
exit /b 1
)
echo Docker is installed and running!
echo.
for /f "tokens=*" %%i in ('docker ps -q -f "name=bee_bot"') do (
echo Stopping existing containers...
docker compose down
)
echo Checking for updates...
git pull
if %errorlevel% neq 0 (
echo Failed to pull updates. Please check your internet connection.
pause
exit /b 1
)
echo.
if not exist .env (
if exist .env-example (
echo Creating .env file from .env-example...
copy .env-example .env
echo Please edit .env file and add your API_ID and API_HASH
notepad .env
) else (
echo Neither .env nor .env-example found!
echo Please create .env file with your configuration
pause
exit /b 1
)
)
echo.
docker compose up -d --build
if %errorlevel% neq 0 (
echo Failed to start Docker containers.
pause
exit /b 1
)
echo.
echo Successfully started! To view logs, type 'docker compose logs -f'
echo To stop the bot, type 'docker compose down'
echo.
echo Press any key to view logs...
pause >nul
docker compose logs -f
endlocal