Add minimal service stubs
This commit is contained in:
10
services/asr/Dockerfile
Normal file
10
services/asr/Dockerfile
Normal file
@@ -0,0 +1,10 @@
|
||||
FROM python:3.11-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY . .
|
||||
|
||||
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||
15
services/asr/app.py
Normal file
15
services/asr/app.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from fastapi import FastAPI
|
||||
import redis
|
||||
import os
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
redis_host = os.getenv("REDIS_HOST", "localhost")
|
||||
redis_port = int(os.getenv("REDIS_PORT", 6379))
|
||||
r = redis.Redis(host=redis_host, port=redis_port, decode_responses=True)
|
||||
|
||||
@app.get("/health")
|
||||
async def health():
|
||||
return {"status": "ok", "service": "asr"}
|
||||
|
||||
# Позже здесь будут эндпоинты для приёма аудио и возврата текста
|
||||
5
services/asr/requirements.txt
Normal file
5
services/asr/requirements.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
fastapi==0.115.0
|
||||
uvicorn[standard]==0.30.1
|
||||
redis==5.0.4
|
||||
pydantic==2.8.2
|
||||
python-dotenv==1.0.1
|
||||
10
services/speaker-id/Dockerfile
Normal file
10
services/speaker-id/Dockerfile
Normal file
@@ -0,0 +1,10 @@
|
||||
FROM python:3.11-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY . .
|
||||
|
||||
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||
16
services/speaker-id/app.py
Normal file
16
services/speaker-id/app.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from fastapi import FastAPI
|
||||
import redis
|
||||
import os
|
||||
import json
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
redis_host = os.getenv("REDIS_HOST", "localhost")
|
||||
redis_port = int(os.getenv("REDIS_PORT", 6379))
|
||||
r = redis.Redis(host=redis_host, port=redis_port, decode_responses=True)
|
||||
|
||||
@app.get("/health")
|
||||
async def health():
|
||||
return {"status": "ok", "service": "speaker-id"}
|
||||
|
||||
# Позже здесь будут эндпоинты для регистрации и идентификации
|
||||
1
services/speaker-id/embeddings.json
Normal file
1
services/speaker-id/embeddings.json
Normal file
@@ -0,0 +1 @@
|
||||
{}
|
||||
5
services/speaker-id/requirements.txt
Normal file
5
services/speaker-id/requirements.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
fastapi==0.115.0
|
||||
uvicorn[standard]==0.30.1
|
||||
redis==5.0.4
|
||||
pydantic==2.8.2
|
||||
python-dotenv==1.0.1
|
||||
10
services/tts/Dockerfile
Normal file
10
services/tts/Dockerfile
Normal file
@@ -0,0 +1,10 @@
|
||||
FROM python:3.11-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY . .
|
||||
|
||||
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||
15
services/tts/app.py
Normal file
15
services/tts/app.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from fastapi import FastAPI
|
||||
import redis
|
||||
import os
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
redis_host = os.getenv("REDIS_HOST", "localhost")
|
||||
redis_port = int(os.getenv("REDIS_PORT", 6379))
|
||||
r = redis.Redis(host=redis_host, port=redis_port, decode_responses=True)
|
||||
|
||||
@app.get("/health")
|
||||
async def health():
|
||||
return {"status": "ok", "service": "tts"}
|
||||
|
||||
# Позже здесь будет эндпоинт /synthesize
|
||||
5
services/tts/requirements.txt
Normal file
5
services/tts/requirements.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
fastapi==0.115.0
|
||||
uvicorn[standard]==0.30.1
|
||||
redis==5.0.4
|
||||
pydantic==2.8.2
|
||||
python-dotenv==1.0.1
|
||||
10
services/vad/Dockerfile
Normal file
10
services/vad/Dockerfile
Normal file
@@ -0,0 +1,10 @@
|
||||
FROM python:3.11-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY . .
|
||||
|
||||
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||
26
services/vad/app.py
Normal file
26
services/vad/app.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from fastapi import FastAPI
|
||||
import redis
|
||||
import os
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
redis_host = os.getenv("REDIS_HOST", "localhost")
|
||||
redis_port = int(os.getenv("REDIS_PORT", 6379))
|
||||
r = redis.Redis(host=redis_host, port=redis_port, decode_responses=True)
|
||||
|
||||
@app.get("/health")
|
||||
async def health():
|
||||
return {"status": "ok", "service": "vad"}
|
||||
|
||||
@app.websocket("/audio-stream")
|
||||
async def audio_stream(websocket):
|
||||
await websocket.accept()
|
||||
print("Client connected to VAD")
|
||||
try:
|
||||
while True:
|
||||
data = await websocket.receive_bytes()
|
||||
# Пока ничего не делаем с данными
|
||||
# В будущем здесь будет VAD-обработка
|
||||
pass
|
||||
except Exception as e:
|
||||
print(f"VAD connection closed: {e}")
|
||||
6
services/vad/requirements.txt
Normal file
6
services/vad/requirements.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
fastapi==0.115.0
|
||||
uvicorn[standard]==0.30.1
|
||||
redis==5.0.4
|
||||
pydantic==2.8.2
|
||||
python-dotenv==1.0.1
|
||||
# Позже добавим silero-vad, numpy, torch и т.д.
|
||||
Reference in New Issue
Block a user