-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_postgres_docker.bat
More file actions
38 lines (34 loc) · 1002 Bytes
/
start_postgres_docker.bat
File metadata and controls
38 lines (34 loc) · 1002 Bytes
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
@echo off
REM Start PostgreSQL Docker container
echo Starting PostgreSQL Docker container...
docker ps -a | findstr postgres_visitor >nul
if %errorlevel% equ 0 (
echo PostgreSQL container exists, starting...
docker start postgres_visitor
) else (
echo Creating and starting PostgreSQL container...
docker run -d --name postgres_visitor ^
-e POSTGRES_DB=visitor_system ^
-e POSTGRES_USER=visitor_user ^
-e POSTGRES_PASSWORD=visitor_pass ^
-p 5432:5432 ^
postgres:15-alpine
)
echo.
echo Waiting for PostgreSQL to be ready...
timeout /t 5 /nobreak >nul
docker ps | findstr postgres_visitor
if %errorlevel% equ 0 (
echo.
echo ✅ PostgreSQL is running on localhost:5432
echo.
echo Database: visitor_system
echo User: visitor_user
echo Password: visitor_pass
echo.
echo Test connection with: psql -h localhost -U visitor_user -d visitor_system
) else (
echo ❌ PostgreSQL failed to start
exit /b 1
)
pause