Files
chorus-services/build-and-push.sh
tony 13364b9e8c Configure external chorus.services domain access
External Domain Configuration:
- Updated Docker Swarm for chorus.services domain (202.171.184.242)
- Configured dashboard.chorus.services for WHOOSH frontend
- Configured api.chorus.services for backend API
- Prepared www.chorus.services for marketing website (ready for submodule)

Traefik Configuration:
- SSL/TLS certificates via Let's Encrypt
- Domain redirects: chorus.services → www.chorus.services
- Proper CORS origins for external access
- Load balancing and high availability

Production Endpoints:
- Marketing Website: https://www.chorus.services (pending project)
- Dashboard: https://dashboard.chorus.services
- API: https://api.chorus.services
- Documentation: https://api.chorus.services/docs

Build System:
- Updated build scripts for website integration
- Registry image preparation: chorus-website:latest
- Management script updates for external domains

Ready for website project integration as git submodule when available.
2025-08-01 09:35:26 +10:00

179 lines
5.0 KiB
Bash
Executable File

#!/bin/bash
# CHORUS Services - Build and Push Script
# Builds all Docker images and pushes them to the local registry
set -e
REGISTRY="registry.home.deepblack.cloud"
REGISTRY_USER="tony"
REGISTRY_PASS="silverfrond[1392]"
TAG="latest"
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Print colored output
print_info() {
echo -e "${BLUE}[INFO]${NC} $1"
}
print_success() {
echo -e "${GREEN}[SUCCESS]${NC} $1"
}
print_warning() {
echo -e "${YELLOW}[WARNING]${NC} $1"
}
print_error() {
echo -e "${RED}[ERROR]${NC} $1"
}
# Docker registry login
docker_login() {
print_info "Logging into Docker registry: $REGISTRY"
echo "$REGISTRY_PASS" | docker login "$REGISTRY" --username "$REGISTRY_USER" --password-stdin
print_success "Successfully logged into registry"
}
# Build and push a single image
build_and_push() {
local name=$1
local context=$2
local dockerfile=${3:-"Dockerfile"}
local image_name="$REGISTRY/tony/chorus-${name}:$TAG"
print_info "Building $name from $context"
if [ -f "$context/$dockerfile" ]; then
docker build -t "$image_name" -f "$context/$dockerfile" "$context"
print_success "Built $image_name"
print_info "Pushing $image_name to registry"
docker push "$image_name"
print_success "Pushed $image_name"
else
print_error "Dockerfile not found: $context/$dockerfile"
return 1
fi
}
# Main build process
main() {
print_info "Starting CHORUS Services build and push process"
# Login to registry
docker_login
# Build and push all images
print_info "Building all CHORUS Services components..."
# WHOOSH Backend
if [ -d "modules/whoosh/backend" ]; then
build_and_push "whoosh-backend" "modules/whoosh/backend"
else
print_warning "WHOOSH backend directory not found - skipping"
fi
# WHOOSH Frontend
if [ -d "modules/whoosh/frontend" ]; then
build_and_push "whoosh-frontend" "modules/whoosh/frontend"
else
print_warning "WHOOSH frontend directory not found - skipping"
fi
# BZZZ Coordinator
if [ -d "modules/bzzz" ]; then
build_and_push "bzzz-coordinator" "modules/bzzz"
else
print_warning "BZZZ directory not found - skipping"
fi
# SLURP API
if [ -d "modules/slurp/hcfs-python" ]; then
build_and_push "slurp-api" "modules/slurp/hcfs-python"
else
print_warning "SLURP API directory not found - skipping"
fi
# SLURP RL Tuner
if [ -d "modules/slurp" ] && [ -f "modules/slurp/Dockerfile.rl-tuner" ]; then
build_and_push "slurp-rl-tuner" "modules/slurp" "Dockerfile.rl-tuner"
else
print_warning "SLURP RL Tuner dockerfile not found - skipping"
fi
# Marketing Website
if [ -d "modules/website" ]; then
build_and_push "website" "modules/website"
else
print_warning "Website directory not found - skipping"
fi
print_success "All CHORUS Services images built and pushed successfully!"
# List pushed images
print_info "Pushed images:"
echo " - $REGISTRY/tony/chorus-whoosh-backend:$TAG"
echo " - $REGISTRY/tony/chorus-whoosh-frontend:$TAG"
echo " - $REGISTRY/tony/chorus-bzzz-coordinator:$TAG"
echo " - $REGISTRY/tony/chorus-slurp-api:$TAG"
echo " - $REGISTRY/tony/chorus-slurp-rl-tuner:$TAG"
echo " - $REGISTRY/tony/chorus-website:$TAG"
}
# Handle command line arguments
case "${1:-}" in
"login")
docker_login
;;
"whoosh-backend")
docker_login
build_and_push "whoosh-backend" "modules/whoosh/backend"
;;
"whoosh-frontend")
docker_login
build_and_push "whoosh-frontend" "modules/whoosh/frontend"
;;
"bzzz")
docker_login
build_and_push "bzzz-coordinator" "modules/bzzz"
;;
"slurp-api")
docker_login
build_and_push "slurp-api" "modules/slurp/hcfs-python"
;;
"slurp-rl-tuner")
docker_login
build_and_push "slurp-rl-tuner" "modules/slurp" "Dockerfile.rl-tuner"
;;
"website")
docker_login
build_and_push "website" "modules/website"
;;
"help"|"-h"|"--help")
echo "CHORUS Services Build and Push Script"
echo ""
echo "Usage: $0 [COMMAND]"
echo ""
echo "Commands:"
echo " (no args) Build and push all images"
echo " login Login to Docker registry only"
echo " whoosh-backend Build and push WHOOSH backend only"
echo " whoosh-frontend Build and push WHOOSH frontend only"
echo " bzzz Build and push BZZZ coordinator only"
echo " slurp-api Build and push SLURP API only"
echo " slurp-rl-tuner Build and push SLURP RL Tuner only"
echo " website Build and push marketing website only"
echo " help Show this help message"
;;
*)
main
;;
esac