feat(video-lab): docker-compose entry + nginx routing (SP-8)
video-lab service: port 18801, REDIS_URL/INTERNAL_API_KEY env, depends_on redis, /app/data volume mount. nginx: /api/video/ proxy + /media/video/ direct serve alias. frontend depends_on + volume mount 추가. Plan-B-Video Phase 1. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -90,6 +90,29 @@ services:
|
|||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 3
|
retries: 3
|
||||||
|
|
||||||
|
video-lab:
|
||||||
|
build:
|
||||||
|
context: ./video-lab
|
||||||
|
container_name: video-lab
|
||||||
|
restart: unless-stopped
|
||||||
|
ports:
|
||||||
|
- "18801:8000"
|
||||||
|
environment:
|
||||||
|
- TZ=${TZ:-Asia/Seoul}
|
||||||
|
- REDIS_URL=${REDIS_URL:-redis://redis:6379}
|
||||||
|
- INTERNAL_API_KEY=${INTERNAL_API_KEY:-}
|
||||||
|
- VIDEO_DATA_DIR=/app/data
|
||||||
|
- CORS_ALLOW_ORIGINS=${CORS_ALLOW_ORIGINS:-http://localhost:3007,http://localhost:8080}
|
||||||
|
volumes:
|
||||||
|
- ${RUNTIME_PATH}/data/video:/app/data
|
||||||
|
depends_on:
|
||||||
|
- redis
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
|
||||||
|
interval: 60s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 3
|
||||||
|
|
||||||
insta-lab:
|
insta-lab:
|
||||||
build:
|
build:
|
||||||
context: ./insta-lab
|
context: ./insta-lab
|
||||||
@@ -265,6 +288,7 @@ services:
|
|||||||
- personal
|
- personal
|
||||||
- packs-lab
|
- packs-lab
|
||||||
- travel-proxy
|
- travel-proxy
|
||||||
|
- video-lab
|
||||||
ports:
|
ports:
|
||||||
- "8080:80"
|
- "8080:80"
|
||||||
volumes:
|
volumes:
|
||||||
@@ -274,6 +298,7 @@ services:
|
|||||||
- ${RUNTIME_PATH}/travel-thumbs:/data/thumbs:ro
|
- ${RUNTIME_PATH}/travel-thumbs:/data/thumbs:ro
|
||||||
- ${RUNTIME_PATH}/data/music:/data/music:ro
|
- ${RUNTIME_PATH}/data/music:/data/music:ro
|
||||||
- ${RUNTIME_PATH}/data/videos:/data/videos:ro
|
- ${RUNTIME_PATH}/data/videos:/data/videos:ro
|
||||||
|
- ${RUNTIME_PATH}/data/video:/data/video:ro
|
||||||
- ${RUNTIME_PATH}/data/insta/insta_cards:/data/insta_cards:ro
|
- ${RUNTIME_PATH}/data/insta/insta_cards:/data/insta_cards:ro
|
||||||
extra_hosts:
|
extra_hosts:
|
||||||
- "host.docker.internal:host-gateway"
|
- "host.docker.internal:host-gateway"
|
||||||
|
|||||||
@@ -36,6 +36,17 @@ server {
|
|||||||
autoindex off;
|
autoindex off;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# video media — Nginx 직접 mp4 서빙
|
||||||
|
location ^~ /media/video/ {
|
||||||
|
alias /data/video/;
|
||||||
|
|
||||||
|
expires 1d;
|
||||||
|
add_header Cache-Control "public, max-age=86400" always;
|
||||||
|
add_header Accept-Ranges bytes always;
|
||||||
|
|
||||||
|
autoindex off;
|
||||||
|
}
|
||||||
|
|
||||||
# music videos — Nginx가 직접 비디오 파일 서빙
|
# music videos — Nginx가 직접 비디오 파일 서빙
|
||||||
location ^~ /media/insta/ {
|
location ^~ /media/insta/ {
|
||||||
alias /data/insta_cards/;
|
alias /data/insta_cards/;
|
||||||
@@ -68,6 +79,21 @@ server {
|
|||||||
proxy_pass http://$music_backend$request_uri;
|
proxy_pass http://$music_backend$request_uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# video-lab — 영상 생성 gateway
|
||||||
|
location /api/video/ {
|
||||||
|
resolver 127.0.0.11 valid=10s;
|
||||||
|
set $video_backend video-lab:8000;
|
||||||
|
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_pass http://$video_backend$request_uri;
|
||||||
|
|
||||||
|
proxy_read_timeout 120s;
|
||||||
|
proxy_connect_timeout 10s;
|
||||||
|
}
|
||||||
|
|
||||||
# realestate API
|
# realestate API
|
||||||
location /api/realestate/ {
|
location /api/realestate/ {
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
|
|||||||
Reference in New Issue
Block a user