Spaces:
Sleeping
Sleeping
| # 1. ํ์ด์ฌ ๋ฒ์ ์ 3.10์ผ๋ก ์ค์ | |
| FROM python:3.11-slim | |
| # 2. ํ์ํ ์์คํ ํจํค์ง ๋ฐ git-lfs ์ค์น | |
| RUN pip install --no-cache-dir hf_transfer>=0.1.6 | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| curl \ | |
| git \ | |
| git-lfs \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # 3. ์์ ๋๋ ํฐ๋ฆฌ ์ค์ | |
| WORKDIR /app | |
| # 4. ์์ค ์ฝ๋ ๋ณต์ฌ | |
| COPY . /app | |
| # 5. Git LFS ์ค์ ๋ฐ ๋์ฉ๋ ํ์ผ ๋ค์ด๋ก๋ | |
| RUN git lfs install && \ | |
| git lfs pull | |
| # 6. ํ์ด์ฌ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ค์น | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # 7. ์คํธ๋ฆผ๋ฆฟ์ด ์ฌ์ฉํ ์ค์ ํด๋๋ฅผ ๋ฏธ๋ฆฌ ๋ง๋ค๊ณ ๊ถํ ๋ถ์ฌ (PermissionError ํด๊ฒฐ) | |
| # ๊ถํ/๊ฒฝ๋ก ๊ณ ์ | |
| ENV HOME=/app | |
| ENV STREAMLIT_HOME=/app/.streamlit | |
| RUN mkdir -p /app/.streamlit && chmod -R 777 /app/.streamlit | |
| # ๊ถ์ฅ: ์บ์ ๊ฒฝ๋ก๋ฅผ ํ๊ฒฝ๋ณ์๋ก ๊ณ ์ | |
| ENV HF_HOME=/tmp/hf-home \ | |
| TRANSFORMERS_CACHE=/tmp/hf-cache \ | |
| HUGGINGFACE_HUB_CACHE=/tmp/hf-cache \ | |
| TORCH_HOME=/tmp/torch-cache \ | |
| XDG_CACHE_HOME=/tmp/xdg-cache | |
| RUN mkdir -p /tmp/hf-home /tmp/hf-cache /tmp/torch-cache /tmp/xdg-cache | |
| # 8. ํฌํธ ๊ฐ๋ฐฉ | |
| EXPOSE 8501 | |
| # 9. ์ฑ ์คํ (PermissionError ์ถ๊ฐ ๋ฐฉ์ง) | |
| CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.fileWatcherType=none"] |