#!/usr/bin/env bash set -euo pipefail ROOT=$(CDPATH='' cd -- "$(dirname -- "$0")/.." && pwd) env_file=${1:-"$ROOT/.env"} if [[ "$env_file" != /* ]]; then env_file="$ROOT/$env_file" fi if [[ ! -f "$env_file" ]]; then echo "Edge environment does not exist: $env_file" >&2 exit 1 fi "$ROOT/scripts/validate-edge-env.sh" "$env_file" edge_compose_project_name=$(awk ' index($0, "EDGE_COMPOSE_PROJECT_NAME=") == 1 { print substr($0, length("EDGE_COMPOSE_PROJECT_NAME=") + 1) exit } ' "$env_file") exec docker compose \ --project-name "$edge_compose_project_name" \ --project-directory "$ROOT" \ --env-file "$env_file" \ --file "$ROOT/compose.edge.yaml" \ up -d --build --wait --remove-orphans