File size: 2,440 Bytes
faaf363
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
version: "3.9"

x-common-env: &common_env
  BELEL_ENV: "prod"
  UVICORN_WORKERS: "2"

services:
  belel-voice:
    build: ./BELEL-VOICE
    container_name: belel-voice
    command: bash -lc "python -m venv .venv && . .venv/bin/activate && pip install -U pip && pip install fastapi uvicorn pydantic httpx rich pyyaml && gunicorn -k uvicorn.workers.UvicornWorker belelvoice.server.app:app --bind 0.0.0.0:8000"
    ports: ["8000:8000"]
    environment:
      <<: *common_env
      VOICE_ENGINE_DEFAULT: "piper"
      ASR_ENGINE_DEFAULT: "faster-whisper"
      PIPER_VOICES_DIR: "/models/piper"
      WHISPER_MODELS_DIR: "/models/whisper"
    volumes:
      - ./models/piper:/models/piper
      - ./models/whisper:/models/whisper
    profiles: ["voice", "federation", "riva"]

  # Optional NVIDIA Riva speech microservices (GPU)
  # Requires: nvidia-docker2 & GPUs available.
  riva-speech:
    image: nvcr.io/nvidia/riva/riva-speech:2.14.0-server
    container_name: riva-speech
    runtime: nvidia
    environment:
      - NVIDIA_VISIBLE_DEVICES=all
    ports: ["50051:50051"]
    volumes:
      - ./riva/models:/data
    profiles: ["riva"]
    deploy:
      resources:
        reservations:
          devices:
            - capabilities: [gpu]

  # BELEL-MED (optional federation)
  belel-med:
    build: ./BELEL-MED
    container_name: belel-med
    command: bash -lc "python -m venv .venv && . .venv/bin/activate && pip install -U pip && pip install fastapi uvicorn pydantic httpx rich && gunicorn -k uvicorn.workers.UvicornWorker src.server.app:app --bind 0.0.0.0:8001"
    ports: ["8001:8001"]
    environment:
      <<: *common_env
      VOICE_GATEWAY_URL: "http://belel-voice:8000"
    depends_on: ["belel-voice"]
    profiles: ["federation"]

  # BELEL-LEX (optional federation)
  belel-lex:
    build: ./BELEL-LEX
    container_name: belel-lex
    command: bash -lc "python -m venv .venv && . .venv/bin/activate && pip install -U pip && pip install fastapi uvicorn pydantic httpx rich && gunicorn -k uvicorn.workers.UvicornWorker belellex.server.app:app --bind 0.0.0.0:8002"
    ports: ["8002:8002"]
    environment:
      <<: *common_env
      VOICE_GATEWAY_URL: "http://belel-voice:8000"
    depends_on: ["belel-voice"]
    profiles: ["federation"]

# Usage:
#   docker compose --profile voice up -d
#   docker compose --profile riva --profile voice up -d
#   docker compose --profile federation up -d   (starts voice + med + lex)