FROM python:3.9-slim # 시스템 의존성 설치 RUN apt-get update && apt-get install -y \ git \ ffmpeg \ && rm -rf /var/lib/apt/lists/* # 작업 디렉토리 설정 WORKDIR /app # 캐시 디렉토리 생성 및 퍼미션 부여 RUN mkdir -p /app/cache && chmod -R 777 /app/cache # 캐시 환경 변수 설정 ENV HF_HOME=/app/cache ENV TRANSFORMERS_CACHE=/app/cache ENV HUGGINGFACE_HUB_CACHE=/app/cache # requirements.txt 설치 COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # 소스 복사 COPY . . # 포트 노출 EXPOSE 7860 # 앱 실행 CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]