#!/usr/bin/env bash

set -euo pipefail

ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
source "${ROOT_DIR}/scripts/docker-prod-common.sh"

start_traefik
start_prod_services postgres redis api homepage carplace dashboard admin
wait_for_healthy api
wait_for_healthy homepage
wait_for_healthy carplace
wait_for_healthy dashboard
wait_for_healthy admin

echo "Production stack is up and healthy: traefik, postgres, redis, api, homepage, carplace, dashboard, admin"
