-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstart.bat
More file actions
92 lines (78 loc) · 2.4 KB
/
start.bat
File metadata and controls
92 lines (78 loc) · 2.4 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
@echo off
REM TSETMC Market Data Service Startup Script for Windows
echo Starting TSETMC Market Data Service...
REM Check if Docker is running
docker info >nul 2>&1
if %errorlevel% neq 0 (
echo ERROR: Docker is not running. Please start Docker first.
pause
exit /b 1
)
REM Check if Docker Compose is available
docker compose version >nul 2>&1
if %errorlevel% neq 0 (
echo ERROR: Docker Compose is not available. Please install Docker Desktop first.
pause
exit /b 1
)
echo SUCCESS: Docker and Docker Compose are available
REM Create logs directory
if not exist logs mkdir logs
REM Start services
echo Starting services with Docker Compose...
docker compose up -d
REM Wait for services to be ready
echo Waiting for services to be ready...
timeout /t 15 /nobreak >nul
REM Check service health
echo Checking service health...
REM Check PostgreSQL
docker compose exec -T postgres pg_isready -U tsetmc_user -d tsetmc_market >nul 2>&1
if %errorlevel% equ 0 (
echo SUCCESS: PostgreSQL is ready
) else (
echo ERROR: PostgreSQL is not ready
)
REM Check Redis
docker compose exec -T redis redis-cli ping >nul 2>&1
if %errorlevel% equ 0 (
echo SUCCESS: Redis is ready
) else (
echo ERROR: Redis is not ready
)
REM Check unified app
timeout /t 5 /nobreak >nul
curl -s http://localhost/api/health >nul 2>&1
if %errorlevel% equ 0 (
echo SUCCESS: TSETMC App is ready
) else (
echo ERROR: TSETMC App is not ready
)
echo.
echo TSETMC Market Data Service is starting up!
echo.
echo Service URLs:
echo Frontend: http://localhost
echo API Documentation: http://localhost:8000/docs
echo Health Check: http://localhost/api/health
echo Market Data: http://localhost/api/market/all
echo Market Status: http://localhost/api/market/status
echo WebSocket Stats: http://localhost/api/websocket/stats
echo.
echo Useful Commands:
echo View logs: docker compose logs -f tsetmc-app
echo Stop services: docker compose down
echo Restart services: docker compose restart
echo Check Redis cache: docker compose exec redis redis-cli
echo.
echo Monitoring:
echo Logs are stored in: .\logs\
echo Database: PostgreSQL on port 5432
echo Cache: Redis on port 6379
echo.
REM Show current market status
echo Current Market Status:
curl -s http://localhost/api/market/status 2>nul | python -m json.tool 2>nul || echo Service is still starting up...
echo.
echo Press any key to continue...
pause >nul