Blueprint & Production Case Study

AI as a Service :
50+ microservices & Sovereign AI gateways operated end to end.

A complete production blueprint: how I built and operate my entire AI as a Service stack — Sovereign AI routers, FastMCP cluster, PostgreSQL 18 with pgvector semantic embeddings, automated CI/CD, and encrypted off-host backups on a single sovereign ARM server.

50+microservices 24/7 in production
4 / 24ARM cores / GB RAM (Always Free)
PG18pgvector semantic search & RAG
8 MCPFastMCP Sovereign AI & Quant gateways

Why, and how

The goal: centralize everything on one free server, without giving up the developer experience of Vercel or Render.

1 · Foundation

Ubuntu 24.04 on an OCI Ampere A1 (ARM64). Two firewall layers — OCI Security List + instance iptables — DuckDNS subdomains with a cron-based IP updater.

2 · The platform

Coolify as a self-hosted PaaS: builds from GitHub, deploys Docker containers, manages env vars and cron. Traefik terminates HTTPS with automatic Let's Encrypt certificates.

3 · The workloads

MCP servers, web services and API servers, each in its own container, routed by hostname and path. Test and prod environments, deployed by git push (Coolify webhook).

4 · The data

Self-hosted PostgreSQL/PostgREST (same API syntax as Supabase — zero code change) plus an Oracle DB. 500+ rows migrated with full-text search intact; automated backups to OCI Object Storage.

Architecture diagrams

The complete picture, from migration flow to service layer.

1 · High-level platform view

The consolidated architecture: GitHub source of truth, dual-layer security edge, OCI Always Free ARM64 compute, FastMCP services, PostgreSQL data layer, and Sovereign AI integration.

High-level OCI AIaaS platform architecture diagram

2 · OCI applications and service map

The complete microservices topology: Traefik TLS routing, web applications (CapGrowth, Mailer, Tracker, Linki, Blackstone), FastMCP cluster (Mistral, Einstein, Saul, Omni, Auto), and PostgreSQL 18 with vector search.

OCI applications, MCP services, data and operations diagram

3 · Mistral Free-mode & Sovereign AI router

The intelligent AI request pipeline: FastMCP TokenGuard authorization, capacity tracking, 24-hour LRU caching, rate limit protection, and automatic fallback to OCI Generative AI Sovereign Cloud.

Mistral Studio Free-mode request, capacity and router flow diagram

4 · Delivery, synchronization and disaster recovery

The automated operational loop: GitHub verified delivery, Coolify automated builds, dual-layer health monitoring, daily encrypted volume backups, and tested disaster-recovery restore.

Delivery, synchronization and disaster recovery flow diagram

Platform services, one by one

The building blocks behind every deployed app: the deployment plane, the data layer, object storage and backups.

Coolify — deployment plane

Builds from GitHub on every push, deploys Docker 27 containers with rolling zero-downtime swaps, manages environment variables and scheduled cron jobs — all driven through its REST API.

Coolify deployment plane diagram

Data layer — PostgreSQL 18 + pgvector + PostgREST + Oracle ATP

A self-hosted, Supabase-compatible data API with pgvector semantic AI embeddings and PostgREST OpenAPI, alongside Oracle ATP 23ai. Zero-loss migration with instant schema introspection.

Arx data layer diagram

MinIO — S3-compatible object storage

High-throughput S3-compatible object storage with presigned URLs for application assets, protected behind Traefik TLS and isolated Docker bridge networking.

MinIO S3 storage diagram

Backups — automated, off-container

Daily 03:00 UTC encrypted snapshots (AES-256) shipped off-host to OCI Object Storage bucket, with automated SHA256 integrity verification and disaster recovery drill validation.

Backups architecture diagram

The stack

ComponentRole
OCI Ampere A1 (ARM64)4 OCPU, 24 GB RAM, Ubuntu 24.04 — Oracle free tier
Docker EngineRuntime for 50+ microservices & containers
CoolifySelf-hosted PaaS: build, deploy, env, cron, REST API
TraefikReverse proxy, automatic Let's Encrypt HTTPS, host/path routing
Mistral AI FastMCP RouterSovereign European AI tier on OCI Ampere: local FastMCP gateway with Codestral & Mistral-Small, rate-limiting, and 24h LRU caching
ARX FastMCP Cluster8 specialized MCP servers (Blackstone quant execution, Einstein deep research, Saul legal, Omni profiling, Auto, Prisme)
PostgreSQL 18 + pgvectorSelf-hosted data layer with AI semantic vector embeddings and PostgREST API
n8n + Redis + ntfySelf-hosted workflow automation, asynchronous task queues, and instant push alerts
MinIOS3-compatible object storage
OCI Object StorageAutomated off-container backups, disaster-recovery restore tested
DuckDNSFree DNS with cron-based IP updates
04 — Implementation & Replication

Replication Blueprint & Full Deployment Checklist

A complete step-by-step checklist and actionable engineering plan to replicate this sovereign, zero-waste AI as a Service platform from scratch.

PHASE 1

Sovereign Infrastructure & Perimeter Hardening

Provision bare compute, configure two-layer firewall isolation, and establish dynamic DNS routing.

Task / ComponentExecution Details & Technical SpecificationVerification
OCI Compute Provisioning Provision OCI Ampere A1 Compute instance (4 OCPU ARM64, 24 GB RAM, 200 GB NVMe storage) on Ubuntu 24.04 LTS. lscpu & free -m
2-Layer Firewall Hardening Configure OCI VCN Ingress Security Rules (ports 80, 443, 22) + Linux Host UFW. Deny all direct database/internal port exposure. ufw status verbose
Dynamic DNS Automation Deploy systemd cron job updating DuckDNS / custom domain API every 5 minutes with WAN IP synchronization. systemctl status duckdns
Docker Engine 27 & Compose Install Docker CE 27.x + Docker Compose plugin from official Docker APT repositories; configure log rotation daemon.json. docker --version
PHASE 2

PaaS Orchestration & Edge Ingress Plane

Deploy self-hosted application control plane, edge TLS termination, and automated Git CI/CD pipelines.

Task / ComponentExecution Details & Technical SpecificationVerification
Coolify PaaS Installation Execute automated installer: curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash. Configure root admin credentials. HTTP 200 on port 8000
Traefik Ingress & TLS Configure Traefik v3 reverse proxy with Let's Encrypt ACME HTTP-01 / DNS-01 auto-renewal and HTTP → HTTPS redirection. A+ SSL Labs rating
GitHub Webhook CI/CD Connect GitHub personal access token / Deploy Keys. Configure webhook endpoints for automatic zero-downtime rolling deploys. Automated push deploy
PHASE 3

Enterprise Data Layer & Semantic Vector Engine

Self-host high-performance PostgreSQL 18 with AI vector search, PostgREST instant APIs, and Redis caching.

Task / ComponentExecution Details & Technical SpecificationVerification
PostgreSQL 18 + pgvector Deploy PostgreSQL 18 container; compile/enable pgvector extension for 1536-dim embedding indexation (HNSW/IVFFlat). CREATE EXTENSION vector;
PostgREST OpenAPI Layer Deploy PostgREST container connected to Postgres internal network for instant Supabase-compatible REST APIs with JWT auth. curl /rpc/... OpenAPI
Dual Redis Caching & Queues Deploy Redis 7 Alpine containers for MCP response caching, session token storage, and asynchronous task coordination. redis-cli ping & PONG
Oracle ATP 23ai Integration Configure Oracle Autonomous Transaction Processing (ATP 23ai) mutual TLS wallet connection for institutional quant storage. mTLS wallet handshake
PHASE 4

Sovereign AI Router & FastMCP Cluster

Deploy intelligent multi-model routing gateway with TokenGuard protection and specialized domain MCP microservices.

Task / ComponentExecution Details & Technical SpecificationVerification
Mistral FastMCP Router Deploy sovereign AI routing gateway running Codestral & Mistral-Small with 24-hour LRU semantic cache and zero-waste rate-limiting. /health & cache hit 200
TokenGuard & Quota Shield Implement per-key rate-limiting (RPS/TPM), automated failover to OCI Sovereign Cloud, and surgical token usage metrics. 429 circuit-breaker test
Domain FastMCP Cluster Deploy domain MCP servers over HTTP/SSE: Blackstone (Quant Execution), Einstein (Deep Web Research), Saul (Legal), Omni (Profiling). 8/8 MCP SSE handshakes
PHASE 5

Workflow Automation, S3 Storage & Backup Loop

Deploy event-driven pipelines, self-hosted object storage, and automated off-host disaster recovery backups.

Task / ComponentExecution Details & Technical SpecificationVerification
MinIO S3 Object Storage Deploy MinIO instance behind Traefik TLS with presigned expiring URLs for document extraction artifacts and assets. S3 PutObject / GetObject
n8n Automation & ntfy Push Deploy n8n workflow engine connected to PostgreSQL and FastMCP triggers; configure ntfy push broker for real-time mobile alerts. Webhook push trigger
Automated Off-Host Backups Schedule daily 03:00 UTC encrypted (AES-256) volume snapshots shipped to OCI Object Storage with 30-day retention policy. Daily S3 bucket checksum
PHASE 6

Validation Drills & Production Go-Live

Execute rigorous end-to-end stress testing, cold disaster recovery drills, and client integration.

Task / ComponentExecution Details & Technical SpecificationVerification
Disaster Recovery Drill Execute simulated cold restore from OCI Object Storage bucket onto an isolated standby container; verify 100% data integrity. Zero data loss validated
Latency & Load Benchmarking Run concurrent load test (k6 / wrk) across Traefik, PostgREST and FastMCP endpoints. Validate sub-20ms P95 API response times. P95 < 20ms under load
Client & Agent Integration Connect Antigravity IDE, Claude Code, and autonomous agents via secure API keys; enable 24/7 autonomous operations. Full autonomous execution