#!/usr/bin/env sh
set -eu

COMPOSE="${COMPOSE:-docker compose}"
BASE_URL="${BASE_URL:-http://127.0.0.1:3010}"

echo "Pruefe Docker Compose Konfiguration..."
$COMPOSE config >/dev/null

echo "Baue Container..."
$COMPOSE build

echo "Starte Container..."
$COMPOSE up -d

echo "Fuehre Healthcheck aus..."
BASE_URL="$BASE_URL" scripts/healthcheck.sh

echo "Deployment abgeschlossen."
