انتقل للمحتوى الرئيسي
الإصدار: 1.0.0-beta

النشر والتوزيع الدليل

Production deployment on OCI, Docker Compose, and air-gapped environments.

النشر والتوزيع Models

ModelInfrastructureBest For
Docker ComposeSingle serverDevelopment, small teams
OCI Shared SaaSOKE shared clusterStandard SaaS customers
OCI Private TenantDedicated OKE namespaceEnterprise customers
On-PremiseCustomer infrastructureSovereign / air-gapped

Docker Compose (Development/Small)

المتطلبات المسبقة

  • Docker 24.0+ with Compose v2
  • 8 GB RAM minimum
  • 50 GB SSD storage

النشر والتوزيع

# Clone and configure
git clone <repo-url>
cd aiia
cp .env.example .env
# Edit .env with production values

# Start all services
docker compose -f docker-compose.yml up -d

# Verify
docker compose ps
curl http://localhost:8005/api/v1/health

Environment Variables

VariableDescriptionRequired
POSTGRES_PASSWORDDatabase password
SECRET_KEYJWT signing key
SECRET_ENCRYPTION_KEYAES-256 key for API key encryption
ENVIRONMENTproduction / development
KEYCLOAK_URLKeycloak base URL
SMTP_HOSTEmail serverRecommended
STRIPE_SECRET_KEYStripe billingOptional
MOYASAR_API_KEYMoyasar paymentsOptional

OCI النشر والتوزيع

الهيكل المعماري

RegionRoleServices
sa-riyadh-1PrimaryOKE, PostgreSQL, Object Storage
sa-jeddah-1DRStandby database, storage replication

OKE (Oracle Kubernetes Engine)

# الاسمspace per tenant
apiVersion: v1
kind: Namespace
metadata:
name: org-{org_id}
labels:
tier: professional
region: sa-riyadh-1

Database

TierDatabase
Shared SaaSShared PostgreSQL, RLS isolation
Private TenantDedicated PostgreSQL instance
SovereignCustomer-managed database

On-Premise / Air-Gapped

Requirements

  • All Docker images pre-loaded into local registry
  • Ollama with locally-downloaded model weights
  • No outbound internet connectivity required
  • Self-signed or internal CA certificates

النشر والتوزيع الخطوات

  1. Transfer Docker images to offline registry
  2. Configure .env for on-premise:
    ENVIRONMENT=production
    AI_PROVIDER=ollama
    OLLAMA_HOST=http://ollama:11434
  3. Start services:
    docker compose -f docker-compose.yml up -d
  4. Generate license key:
    python -m app.services.license_service keygen
    python -m app.services.license_service generate \
    --org-id 1 --tier sovereign --months 12

Monitoring

Health Endpoints

EndpointPurpose
GET /api/v1/healthBasic health
GET /api/v1/system/statusFull status
GET /metricsPrometheus metrics

Grafana لوحات المعلومات

Pre-configured at http://instance:3003:

  • API latency and throughput
  • Database connections
  • Worker task queue
  • Error rates
  • Resource utilization

النسخ الاحتياطي والاستعادة

ComponentStrategyFrequency
PostgreSQLpg_dump / streaming replicationDaily
MinIOMirror replicationReal-time
RedisRDB snapshotsHourly
ConfigVersion-controlled filesOn change