Menu
Public repository / 7c20bfc03c11ad45182bbadd48707716a287085a
AkurAI-Platform / scripts/deploy-ec2.sh
Latest change 0183a48e4f75fa9dcea1bf01af89c93ddb3fe5be - Refactor platform into a polished SaaS product-suite front door by Olafur Bui
#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
FRAMEWORK="${AKURAI_FRAMEWORK:-/home/olafurbui/Projects/AkurAI-Framework}"
BIN="${AKURAI_BIN:-$FRAMEWORK/target/x86_64-unknown-linux-musl/release/akurai}"
NAME="akurai-platform"
PORT="8098"
DOMAIN="${AKURAI_PLATFORM_DOMAIN:-platform.olibuijr.com}"
if [[ ! -x "$BIN" ]]; then
(cd "$FRAMEWORK" && cargo build --release --target x86_64-unknown-linux-musl -p akurai)
fi
akurai-ec2 deploy-binary "$NAME" "$BIN" "$PORT" "$ROOT"
akurai-ec2 nginx-proxy "$DOMAIN" "$PORT"
# nginx-proxy only scaffolds the HTTP vhost; (re)attach the TLS cert so the
# public 443 block keeps pointing at this app. Idempotent — reuses the existing
# Let's Encrypt cert when one is present, otherwise obtains it via certbot.
akurai-ec2 tls "$DOMAIN"
akurai-ec2 ssh "curl -fsS http://127.0.0.1:$PORT/api/health >/dev/null && systemctl is-active $NAME.service"