-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-database.sh
More file actions
38 lines (31 loc) Β· 958 Bytes
/
setup-database.sh
File metadata and controls
38 lines (31 loc) Β· 958 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
#!/bin/bash
echo "π Setting up AI Parking System Database..."
echo
# Check if Docker is installed
if ! command -v docker &> /dev/null; then
echo "β Docker is not installed or not in PATH"
echo "Please install Docker from https://www.docker.com/get-started"
exit 1
fi
echo "β
Docker found"
echo
# Start PostgreSQL and Redis using Docker Compose
echo "π³ Starting PostgreSQL and Redis containers..."
docker-compose -f docker-compose.dev.yml up -d
# Wait for PostgreSQL to be ready
echo "β³ Waiting for PostgreSQL to be ready..."
sleep 10
# Check if PostgreSQL is running
docker-compose -f docker-compose.dev.yml ps postgres
echo
echo "β
Database setup complete!"
echo
echo "π Database Connection Details:"
echo " Host: localhost"
echo " Port: 5432"
echo " Database: ai_parking_system"
echo " Username: postgres"
echo " Password: password"
echo
echo "π You can now start the backend server with: npm run dev"
echo