박재오 발견: Kling 공식 API key 발급 (Access Key + Secret Key).
PiAPI gateway가 아닌 native api.klingai.com 사용.
변경:
- providers/kling.py: JWT 인증 (HS256, iss=access_key, exp=now+1800, nbf=now-5).
POST /v1/videos/text2video → GET /v1/videos/{kind}/{task_id} 폴링.
data.task_result.videos[0].url 다운로드.
text2video / image2video 자동 분기.
- .env.example: PIAPI_API_KEY → KLING_ACCESS_KEY + KLING_SECRET_KEY
- docker-compose: 같은 env 교체
- requirements.txt: + PyJWT>=2.8.0
박재오 측: .env에 두 키 모두 입력.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
79 lines
2.7 KiB
YAML
79 lines
2.7 KiB
YAML
name: web-ai-services
|
|
|
|
services:
|
|
insta-render:
|
|
build:
|
|
context: ./insta-render
|
|
container_name: insta-render
|
|
restart: unless-stopped
|
|
ports:
|
|
- "18710:8000"
|
|
environment:
|
|
- TZ=Asia/Seoul
|
|
- REDIS_URL=${REDIS_URL:-redis://192.168.45.54:6379}
|
|
- NAS_BASE_URL=${NAS_BASE_URL:-http://192.168.45.54:18700}
|
|
- INTERNAL_API_KEY=${INTERNAL_API_KEY:-}
|
|
- INSTA_MEDIA_ROOT=${INSTA_MEDIA_ROOT:-/mnt/nas/webpage/data/insta}
|
|
- INSTA_MEDIA_URL_PREFIX=${INSTA_MEDIA_URL_PREFIX:-/media/insta}
|
|
- CARD_TEMPLATE_DIR=/app/templates
|
|
volumes:
|
|
- /mnt/nas/webpage/data/insta:/mnt/nas/webpage/data/insta
|
|
healthcheck:
|
|
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
|
|
interval: 60s
|
|
timeout: 5s
|
|
retries: 3
|
|
|
|
music-render:
|
|
build:
|
|
context: ./music-render
|
|
container_name: music-render
|
|
restart: unless-stopped
|
|
ports:
|
|
- "18711:8000"
|
|
environment:
|
|
- TZ=Asia/Seoul
|
|
- REDIS_URL=${REDIS_URL:-redis://192.168.45.54:6379}
|
|
- NAS_BASE_URL=${NAS_BASE_URL:-http://192.168.45.54:18600}
|
|
- INTERNAL_API_KEY=${INTERNAL_API_KEY:-}
|
|
- SUNO_API_KEY=${SUNO_API_KEY:-}
|
|
- MUSIC_AI_SERVER_URL=${MUSIC_AI_SERVER_URL:-http://host.docker.internal:8765}
|
|
- MUSIC_MEDIA_ROOT=${MUSIC_MEDIA_ROOT:-/mnt/nas/webpage/data/music}
|
|
- MUSIC_MEDIA_URL_PREFIX=${MUSIC_MEDIA_URL_PREFIX:-/media/music}
|
|
extra_hosts:
|
|
- "host.docker.internal:host-gateway"
|
|
volumes:
|
|
- /mnt/nas/webpage/data/music:/mnt/nas/webpage/data/music
|
|
healthcheck:
|
|
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
|
|
interval: 60s
|
|
timeout: 5s
|
|
retries: 3
|
|
|
|
video-render:
|
|
build:
|
|
context: ./video-render
|
|
container_name: video-render
|
|
restart: unless-stopped
|
|
ports:
|
|
- "18712:8000"
|
|
environment:
|
|
- TZ=Asia/Seoul
|
|
- REDIS_URL=${REDIS_URL:-redis://192.168.45.54:6379}
|
|
- NAS_BASE_URL=${NAS_BASE_URL:-http://192.168.45.54:18801}
|
|
- INTERNAL_API_KEY=${INTERNAL_API_KEY:-}
|
|
- OPENAI_API_KEY=${OPENAI_API_KEY:-}
|
|
- GEMINI_API_KEY=${GEMINI_API_KEY:-}
|
|
- KLING_ACCESS_KEY=${KLING_ACCESS_KEY:-}
|
|
- KLING_SECRET_KEY=${KLING_SECRET_KEY:-}
|
|
- SEEDANCE_API_KEY=${SEEDANCE_API_KEY:-}
|
|
- VIDEO_MEDIA_ROOT=${VIDEO_MEDIA_ROOT:-/mnt/nas/webpage/data/video}
|
|
- VIDEO_MEDIA_URL_PREFIX=${VIDEO_MEDIA_URL_PREFIX:-/media/video}
|
|
volumes:
|
|
- /mnt/nas/webpage/data/video:/mnt/nas/webpage/data/video
|
|
healthcheck:
|
|
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
|
|
interval: 60s
|
|
timeout: 5s
|
|
retries: 3
|