307 lines
8.4 KiB
YAML
307 lines
8.4 KiB
YAML
services:
|
|
# ---------------------------------------------------------------------------
|
|
# Infrastructure
|
|
# ---------------------------------------------------------------------------
|
|
redis:
|
|
image: redis:7-alpine
|
|
container_name: imajin-redis
|
|
ports:
|
|
- "6379:6379"
|
|
volumes:
|
|
- redis-data:/data
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Core Pipeline Services
|
|
# ---------------------------------------------------------------------------
|
|
request-classifier:
|
|
build:
|
|
context: services/imajin-request-classifier
|
|
dockerfile: Dockerfile
|
|
container_name: imajin-request-classifier
|
|
ports:
|
|
- "8001:8001"
|
|
environment:
|
|
- REDIS_URL=redis://redis:6379
|
|
- IMAJIN_CLASSIFIER_PORT=8001
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "python", "-c", "import httpx; httpx.get('http://localhost:8001/health').raise_for_status()"]
|
|
interval: 15s
|
|
timeout: 10s
|
|
start_period: 30s
|
|
retries: 3
|
|
restart: unless-stopped
|
|
|
|
prompt:
|
|
build:
|
|
context: services/imajin-prompt/service
|
|
dockerfile: Dockerfile
|
|
container_name: imajin-prompt
|
|
ports:
|
|
- "8003:8003"
|
|
environment:
|
|
- REDIS_URL=redis://redis:6379
|
|
volumes:
|
|
- huggingface-cache:/root/.cache/huggingface
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
request-classifier:
|
|
condition: service_healthy
|
|
deploy:
|
|
resources:
|
|
reservations:
|
|
devices:
|
|
- driver: nvidia
|
|
count: 1
|
|
capabilities: [gpu]
|
|
healthcheck:
|
|
test: ["CMD", "python3.12", "-c", "import httpx; httpx.get('http://localhost:8003/health').raise_for_status()"]
|
|
interval: 15s
|
|
timeout: 10s
|
|
start_period: 60s
|
|
retries: 3
|
|
restart: unless-stopped
|
|
|
|
diffusion:
|
|
build:
|
|
context: services/imajin-diffusion/service
|
|
dockerfile: Dockerfile
|
|
container_name: imajin-diffusion
|
|
ports:
|
|
- "8002:8002"
|
|
environment:
|
|
- REDIS_URL=redis://redis:6379
|
|
volumes:
|
|
- huggingface-cache:/root/.cache/huggingface
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
prompt:
|
|
condition: service_healthy
|
|
deploy:
|
|
resources:
|
|
reservations:
|
|
devices:
|
|
- driver: nvidia
|
|
count: 1
|
|
capabilities: [gpu]
|
|
healthcheck:
|
|
test: ["CMD", "python3.12", "-c", "import httpx; httpx.get('http://localhost:8002/health').raise_for_status()"]
|
|
interval: 15s
|
|
timeout: 10s
|
|
start_period: 120s
|
|
retries: 3
|
|
restart: unless-stopped
|
|
|
|
processing:
|
|
build:
|
|
context: services/imajin-processing/service
|
|
dockerfile: Dockerfile
|
|
container_name: imajin-processing
|
|
ports:
|
|
- "8004:8004"
|
|
environment:
|
|
- PORT=8004
|
|
healthcheck:
|
|
test: ["CMD", "node", "-e", "fetch('http://localhost:8004/health').then(r => { if (!r.ok) process.exit(1) })"]
|
|
interval: 15s
|
|
timeout: 10s
|
|
start_period: 15s
|
|
retries: 3
|
|
restart: unless-stopped
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Quality & Safety Services
|
|
# ---------------------------------------------------------------------------
|
|
aesthetic:
|
|
build:
|
|
context: services/imajin-aesthetic/service
|
|
dockerfile: Dockerfile
|
|
container_name: imajin-aesthetic
|
|
ports:
|
|
- "8006:8006"
|
|
environment:
|
|
- REDIS_URL=redis://redis:6379
|
|
volumes:
|
|
- huggingface-cache:/root/.cache/huggingface
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
deploy:
|
|
resources:
|
|
reservations:
|
|
devices:
|
|
- driver: nvidia
|
|
count: 1
|
|
capabilities: [gpu]
|
|
healthcheck:
|
|
test: ["CMD", "python3.12", "-c", "import httpx; httpx.get('http://localhost:8006/health').raise_for_status()"]
|
|
interval: 15s
|
|
timeout: 10s
|
|
start_period: 60s
|
|
retries: 3
|
|
restart: unless-stopped
|
|
|
|
semantic:
|
|
build:
|
|
context: services/imajin-semantic/service
|
|
dockerfile: Dockerfile
|
|
container_name: imajin-semantic
|
|
ports:
|
|
- "8007:8007"
|
|
environment:
|
|
- REDIS_URL=redis://redis:6379
|
|
- SEMANTIC_SERVICE_PORT=8007
|
|
volumes:
|
|
- huggingface-cache:/root/.cache/huggingface
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
deploy:
|
|
resources:
|
|
reservations:
|
|
devices:
|
|
- driver: nvidia
|
|
count: 1
|
|
capabilities: [gpu]
|
|
healthcheck:
|
|
test: ["CMD", "python3.12", "-c", "import httpx; httpx.get('http://localhost:8007/health').raise_for_status()"]
|
|
interval: 15s
|
|
timeout: 10s
|
|
start_period: 60s
|
|
retries: 3
|
|
restart: unless-stopped
|
|
|
|
moderator:
|
|
build:
|
|
context: services/imajin-moderator/service
|
|
dockerfile: Dockerfile
|
|
container_name: imajin-moderator
|
|
ports:
|
|
- "8008:8008"
|
|
environment:
|
|
- REDIS_URL=redis://redis:6379
|
|
volumes:
|
|
- huggingface-cache:/root/.cache/huggingface
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
deploy:
|
|
resources:
|
|
reservations:
|
|
devices:
|
|
- driver: nvidia
|
|
count: 1
|
|
capabilities: [gpu]
|
|
healthcheck:
|
|
test: ["CMD", "python3.12", "-c", "import httpx; httpx.get('http://localhost:8008/health').raise_for_status()"]
|
|
interval: 15s
|
|
timeout: 10s
|
|
start_period: 60s
|
|
retries: 3
|
|
restart: unless-stopped
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Identity Service
|
|
# ---------------------------------------------------------------------------
|
|
identity:
|
|
build:
|
|
context: services/imajin-identity/service
|
|
dockerfile: Dockerfile
|
|
container_name: imajin-identity
|
|
ports:
|
|
- "8009:8009"
|
|
environment:
|
|
- REDIS_URL=redis://redis:6379
|
|
volumes:
|
|
- huggingface-cache:/root/.cache/huggingface
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
deploy:
|
|
resources:
|
|
reservations:
|
|
devices:
|
|
- driver: nvidia
|
|
count: 1
|
|
capabilities: [gpu]
|
|
healthcheck:
|
|
test: ["CMD", "python3.12", "-c", "import httpx; httpx.get('http://localhost:8009/health').raise_for_status()"]
|
|
interval: 15s
|
|
timeout: 10s
|
|
start_period: 60s
|
|
retries: 3
|
|
restart: unless-stopped
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Video Processing Service
|
|
# ---------------------------------------------------------------------------
|
|
video:
|
|
build:
|
|
context: services/imajin-video/service
|
|
dockerfile: Dockerfile
|
|
container_name: imajin-video
|
|
ports:
|
|
- "8010:8010"
|
|
environment:
|
|
- REDIS_URL=redis://redis:6379
|
|
volumes:
|
|
- imajin-video-output:/tmp/imajin-video-output
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
deploy:
|
|
resources:
|
|
reservations:
|
|
devices:
|
|
- driver: nvidia
|
|
count: 1
|
|
capabilities: [gpu]
|
|
healthcheck:
|
|
test: ["CMD", "python3.12", "-c", "import httpx; httpx.get('http://localhost:8010/health').raise_for_status()"]
|
|
interval: 15s
|
|
timeout: 10s
|
|
start_period: 60s
|
|
retries: 3
|
|
restart: unless-stopped
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Adversarial ML Service (face recognition cloaking + detection evasion)
|
|
# ---------------------------------------------------------------------------
|
|
adversarial:
|
|
build:
|
|
context: services/imajin-adversarial/service
|
|
dockerfile: Dockerfile
|
|
container_name: imajin-adversarial
|
|
ports:
|
|
- "8011:8011"
|
|
environment:
|
|
- REDIS_URL=redis://redis:6379
|
|
deploy:
|
|
resources:
|
|
reservations:
|
|
devices:
|
|
- driver: nvidia
|
|
count: 1
|
|
capabilities: [gpu]
|
|
healthcheck:
|
|
test: ["CMD", "python3.12", "-c", "import httpx; httpx.get('http://localhost:8011/health').raise_for_status()"]
|
|
interval: 15s
|
|
timeout: 10s
|
|
start_period: 120s
|
|
retries: 3
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
redis-data:
|
|
huggingface-cache:
|
|
imajin-video-output:
|