59 lines
1.4 KiB
PowerShell
59 lines
1.4 KiB
PowerShell
# Define your Docker Compose directory
|
|
$composeDir = "C:\Users\johnn\Desktop\Docker\Booked Scheduler"
|
|
|
|
# Create the directory if it does not exist
|
|
if (-not (Test-Path $composeDir)) {
|
|
New-Item -ItemType Directory -Path $composeDir
|
|
}
|
|
|
|
# Change to the target directory
|
|
Set-Location -Path $composeDir
|
|
|
|
# Create a docker-compose.yml file for Booked Scheduler
|
|
$dockerComposeContent = @"
|
|
version: '3.8'
|
|
|
|
services:
|
|
booked:
|
|
image: booked-scheduler/booked:latest
|
|
container_name: booked_scheduler
|
|
ports:
|
|
- "8080:80"
|
|
environment:
|
|
- DB_HOST=db
|
|
- DB_PORT=5432
|
|
- DB_NAME=booked_db
|
|
- DB_USER=booked_user
|
|
- DB_PASSWORD=secret
|
|
depends_on:
|
|
- db
|
|
restart: unless-stopped
|
|
|
|
db:
|
|
image: postgres:13
|
|
container_name: booked_db
|
|
environment:
|
|
POSTGRES_USER: booked_user
|
|
POSTGRES_PASSWORD: secret
|
|
POSTGRES_DB: booked_db
|
|
volumes:
|
|
- booked_db_data:/var/lib/postgresql/data
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
booked_db_data:
|
|
"@
|
|
|
|
# Write docker-compose.yml to the directory
|
|
$dockerComposeContent | Out-File -FilePath "$composeDir\docker-compose.yml" -Force
|
|
|
|
# Pull the Docker images and start the containers
|
|
Write-Host "Running docker-compose up..."
|
|
docker-compose -f "$composeDir\docker-compose.yml" up -d
|
|
|
|
# Check if everything is running
|
|
Write-Host "Checking the status of the containers..."
|
|
docker ps
|
|
|
|
Write-Host "Booked Scheduler setup completed. You can access it at http://localhost:8080"
|