forked from intuitem/ciso-assistant-community
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.sh
More file actions
executable file
·26 lines (22 loc) · 961 Bytes
/
docker-compose.sh
File metadata and controls
executable file
·26 lines (22 loc) · 961 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
#! /bin/bash
set -euo pipefail
DOCKER_COMPOSE_FILE=docker-compose.yml
if [ -d ./db ]; then
echo "The database seems already created. You should launch 'docker compose up -d' instead."
echo "For a clean start, you can remove the db folder, and then run 'docker compose rm -fs' and start over"
exit 1
fi
echo "Starting CISO Assistant services..."
docker compose pull
echo "Initializing the database. This can take up to 2 minutes, please wait.."
docker compose up -d
echo "Waiting for CISO Assistant backend to be ready..."
until docker compose exec -T backend curl -f http://localhost:8000/api/health/ >/dev/null 2>&1; do
echo "Backend is not ready - waiting 10s..."
sleep 10
done
echo -e "Backend is ready!"
echo "Creating superuser..."
docker compose exec backend poetry run python manage.py createsuperuser
echo -e "Initialization complete!"
echo "You can now access CISO Assistant at https://localhost:8443 (or the host:port you've specified)"