File size: 1,252 Bytes
6af1993
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

#!/usr/bin/env bash
set -euo pipefail

echo "[SOVEREIGN] Installing appliance (offline)…"

ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$ROOT_DIR"

# Check docker
if ! command -v docker >/dev/null 2>&1; then
  echo "[ERROR] Docker is not installed. Please install Docker Engine first."
  exit 1
fi

# Check compose
if ! docker compose version >/dev/null 2>&1; then
  echo "[ERROR] Docker Compose not available. Please install docker compose."
  exit 1
fi

# Create deploy/.env if missing
mkdir -p ./deploy
if [ ! -f "./deploy/.env" ]; then
  if [ -f "./deploy/env.example" ]; then
    cp "./deploy/env.example" "./deploy/.env"
    echo "[SOVEREIGN] Created deploy/.env from env.example"
  else
    echo "[ERROR] deploy/env.example missing"
    exit 1
  fi
fi

# Load offline images if present
mkdir -p ./images
shopt -s nullglob
TARFILES=(./images/*.tar)
if [ ${#TARFILES[@]} -gt 0 ]; then
  for t in "${TARFILES[@]}"; do
    echo "[SOVEREIGN] Loading image: $t"
    docker load -i "$t"
  done
else
  echo "[WARN] No image tar files found in ./images. (This is OK for now.)"
fi

# Start
echo "[SOVEREIGN] Starting containers..."
docker compose --env-file ./deploy/.env -f ./deploy/docker-compose.yml up -d

echo "[SOVEREIGN] Done."