FROM python:3.10-slim # 작업 디렉토리 WORKDIR /app # 필수 패키지 설치 RUN apt-get update && apt-get install -y \ build-essential \ curl \ software-properties-common \ git \ libgl1-mesa-glx \ libglib2.0-0 \ libsm6 \ libxext6 \ libxrender-dev \ && rm -rf /var/lib/apt/lists/* # Hugging Face 캐시 디렉토리 RUN mkdir -p /app/hf_cache && chmod -R 777 /app/hf_cache ENV TRANSFORMERS_CACHE=/app/hf_cache ENV HF_HOME=/app/hf_cache # 의존성 설치 COPY requirements.txt ./ COPY src/ ./src/ RUN pip install --no-cache-dir -r requirements.txt # 포트/헬스체크 EXPOSE 8501 HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1 # 실행 ENTRYPOINT ["streamlit", "run", "src/app.py", "--server.port=8501", "--server.address=0.0.0.0"]