18d684b501
- docker-compose.yml stt-service 를 profiles:[legacy] 로 이동. GPU 의 stt-service 는 더 이상 기동하지 않고, fastapi STT_ENDPOINT 가 Mac mini (기본 100.76.254.116:8804 Tailscale, MAC_MINI_HOST env 로 LAN IP 주입) 를 바라보도록 변경. 복원 필요 시 `docker compose --profile legacy up -d stt-service`. - config.yaml: classifier 섹션을 gemma4:e4b-it-q8_0 으로 복원. 이전 B-0 커밋이 classifier 를 주석 처리했는데, 실제로는 classifier_service 가 쓰고 있어 gate 유효. exaone 은 이미 제거됐으니 모델만 gemma4 로 통일. classifier_service 의 hasattr 체크는 유지되어 fallback 안전. D13 (STT 이전) drift 를 main 으로 승격. inventory 갱신은 B-3 마감 단계에서 3-tier + STT 경로 묶어서 일괄. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
194 lines
5.6 KiB
YAML
194 lines
5.6 KiB
YAML
services:
|
|
postgres:
|
|
image: pgvector/pgvector:pg16
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
- ./migrations:/docker-entrypoint-initdb.d
|
|
environment:
|
|
POSTGRES_DB: pkm
|
|
POSTGRES_USER: pkm
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
|
ports:
|
|
- "127.0.0.1:15432:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U pkm"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
|
|
kordoc-service:
|
|
build: ./services/kordoc
|
|
ports:
|
|
- "127.0.0.1:3100:3100"
|
|
volumes:
|
|
- ${NAS_NFS_PATH:-/mnt/nas/Document_Server}:/documents:ro
|
|
mem_limit: 4g
|
|
memswap_limit: 4g
|
|
healthcheck:
|
|
test: ["CMD", "node", "-e", "fetch('http://localhost:3100/health').then(r=>{process.exit(r.ok?0:1)}).catch(()=>process.exit(1))"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 3
|
|
restart: unless-stopped
|
|
|
|
ocr-service:
|
|
build: ./services/ocr
|
|
expose:
|
|
- "3200"
|
|
volumes:
|
|
- ${NAS_NFS_PATH:-/mnt/nas/Document_Server}:/documents:ro
|
|
- ocr_models:/root/.cache
|
|
deploy:
|
|
resources:
|
|
reservations:
|
|
devices:
|
|
- driver: nvidia
|
|
count: 1
|
|
capabilities: [gpu]
|
|
healthcheck:
|
|
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:3200/health')"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 180s
|
|
restart: unless-stopped
|
|
|
|
stt-service:
|
|
# 2026-04-24: STT 가 Mac mini (faster-whisper, 192.168.1.122:8804 / 100.76.254.116:8804)
|
|
# 로 이전됨. GPU 에서 컨테이너는 더 이상 기동하지 않는다. 복원이 필요하면
|
|
# `docker compose --profile legacy up -d stt-service` 로 legacy 프로파일 활성화.
|
|
# fastapi 의 STT_ENDPOINT 도 Mac mini 주소를 가리킴 (아래 environment 참고).
|
|
profiles: [legacy]
|
|
build: ./services/stt
|
|
expose:
|
|
- "3300"
|
|
volumes:
|
|
- ${NAS_NFS_PATH:-/mnt/nas/Document_Server}:/documents:ro
|
|
- stt_models:/root/.cache
|
|
environment:
|
|
- WHISPER_MODEL=${WHISPER_MODEL:-large-v3}
|
|
- WHISPER_DEVICE=${WHISPER_DEVICE:-cuda}
|
|
- WHISPER_COMPUTE_TYPE=${WHISPER_COMPUTE_TYPE:-float16}
|
|
deploy:
|
|
resources:
|
|
reservations:
|
|
devices:
|
|
- driver: nvidia
|
|
count: 1
|
|
capabilities: [gpu]
|
|
healthcheck:
|
|
# /ready: CUDA 디바이스 + 모델 적재 둘 다 확인. ready=true 만 healthy 처리.
|
|
# /health 는 단순 liveness 라 모델 미적재 상태도 healthy 로 잡혀 운영 신호로 부적합.
|
|
test: ["CMD", "python3", "-c", "import json,urllib.request,sys; r=urllib.request.urlopen('http://localhost:3300/ready'); sys.exit(0 if json.load(r).get('ready') else 1)"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 300s
|
|
restart: unless-stopped
|
|
|
|
ollama:
|
|
image: ollama/ollama
|
|
volumes:
|
|
- ollama_data:/root/.ollama
|
|
deploy:
|
|
resources:
|
|
reservations:
|
|
devices:
|
|
- driver: nvidia
|
|
count: 1
|
|
capabilities: [gpu]
|
|
ports:
|
|
- "127.0.0.1:11434:11434"
|
|
restart: unless-stopped
|
|
|
|
# Phase 1.3: bge-reranker-v2-m3 (TEI) — internal only, fastapi에서 reranker:80으로 호출
|
|
# fastapi가 depends_on 안 함 → 단독 시작 가능, 없어도 fastapi 동작 (rerank=false fallback)
|
|
reranker:
|
|
image: ghcr.io/huggingface/text-embeddings-inference:1.7
|
|
container_name: hyungi_document_server-reranker-1
|
|
expose:
|
|
- "80"
|
|
environment:
|
|
- MODEL_ID=BAAI/bge-reranker-v2-m3
|
|
- MAX_BATCH_TOKENS=8192
|
|
- MAX_CONCURRENT_REQUESTS=4
|
|
volumes:
|
|
- reranker_cache:/data
|
|
deploy:
|
|
resources:
|
|
reservations:
|
|
devices:
|
|
- driver: nvidia
|
|
count: 1
|
|
capabilities: [gpu]
|
|
restart: unless-stopped
|
|
|
|
ai-gateway:
|
|
build: ./gpu-server/services/ai-gateway
|
|
ports:
|
|
- "127.0.0.1:8081:8080"
|
|
environment:
|
|
- PRIMARY_ENDPOINT=http://100.76.254.116:8801/v1/chat/completions
|
|
- FALLBACK_ENDPOINT=http://ollama:11434/v1/chat/completions
|
|
- CLAUDE_API_KEY=${CLAUDE_API_KEY:-}
|
|
- DAILY_BUDGET_USD=${DAILY_BUDGET_USD:-5.00}
|
|
depends_on:
|
|
- ollama
|
|
restart: unless-stopped
|
|
|
|
fastapi:
|
|
build: ./app
|
|
ports:
|
|
- "127.0.0.1:8000:8000"
|
|
volumes:
|
|
- ${NAS_NFS_PATH:-/mnt/nas/Document_Server}:/documents
|
|
- ./config.yaml:/app/config.yaml:ro
|
|
- ./domain_policy.yaml:/app/domain_policy.yaml:ro
|
|
- ./scripts:/app/scripts:ro
|
|
- ./logs:/app/logs
|
|
- ./migrations:/app/migrations:ro
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
kordoc-service:
|
|
condition: service_healthy
|
|
env_file:
|
|
- credentials.env
|
|
environment:
|
|
- DATABASE_URL=postgresql+asyncpg://pkm:${POSTGRES_PASSWORD}@postgres:5432/pkm
|
|
- KORDOC_ENDPOINT=http://kordoc-service:3100
|
|
- OCR_ENDPOINT=http://ocr-service:3200
|
|
# 2026-04-24 STT Mac mini 이전: 기본값 100.76.254.116:8804 (Tailscale), 필요 시
|
|
# MAC_MINI_HOST env 로 192.168.1.122 등 LAN IP 주입.
|
|
- STT_ENDPOINT=http://${MAC_MINI_HOST:-100.76.254.116}:8804
|
|
restart: unless-stopped
|
|
|
|
frontend:
|
|
build: ./frontend
|
|
ports:
|
|
- "127.0.0.1:3000:3000"
|
|
depends_on:
|
|
- fastapi
|
|
restart: unless-stopped
|
|
|
|
caddy:
|
|
image: caddy:2
|
|
ports:
|
|
- "8080:80"
|
|
volumes:
|
|
- ./Caddyfile:/etc/caddy/Caddyfile
|
|
- caddy_data:/data
|
|
depends_on:
|
|
- fastapi
|
|
- frontend
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
pgdata:
|
|
caddy_data:
|
|
ollama_data:
|
|
reranker_cache:
|
|
ocr_models:
|
|
stt_models:
|