forked from intuitem/ciso-assistant-community
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.ps1
19 lines (18 loc) · 988 Bytes
/
docker-compose.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#! /usr/bin/env pwsh
# Check if the database file exists
if (Test-Path "db/ciso-assistant.sqlite3") {
Write-Output "The database seems already created."
Write-Output "You should launch docker-compose up -d."
Write-Output "For a clean start, you can remove the database file, run docker-compose down and then docker-compose rm and start again."
} else {
# Remove existing Docker images
docker rmi ghcr.io/intuitem/ciso-assistant-community/backend:latest ghcr.io/intuitem/ciso-assistant-community/frontend:latest 2> $null
# Bring up the Docker Compose services
docker-compose up -d
Write-Output "Giving some time for the database to be ready, please wait ..."
Start-Sleep -Seconds 20
Write-Output "Initialize your superuser account..."
docker-compose exec backend python manage.py createsuperuser
Write-Output "Connect to CISO Assistant on https://localhost:8443"
Write-Output "For successive runs, you can now use docker-compose up."
}