Spaces:
Sleeping
Sleeping
File size: 1,285 Bytes
edc830f 42478ea f0556b9 e182467 6a7a44d f0556b9 c6a6e7c f0556b9 e182467 72a9ec5 e182467 b7a20e5 f0556b9 e182467 c6a6e7c e182467 42478ea f0556b9 edc830f b7a20e5 e182467 3308e49 e182467 9daa5a0 f0556b9 edc830f b27abf1 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# 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"] |