Spaces:
Sleeping
Sleeping
File size: 864 Bytes
c9ace58 177c934 c9ace58 177c934 c9ace58 177c934 c9ace58 177c934 c9ace58 974811d |
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 |
# Python 3.9 ์ฌ๋ฆผ ๋ฒ์ ์ฌ์ฉ
FROM python:3.9-slim
# ์์
๋๋ ํ ๋ฆฌ ์ค์
WORKDIR /app
# ์์คํ
ํจํค์ง ์
๋ฐ์ดํธ ๋ฐ ํ์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ค์น
# libgomp1: faiss-cpu ์คํ์ ํ์
RUN apt-get update && apt-get install -y \
build-essential \
libgomp1 \
&& rm -rf /var/lib/apt/lists/*
# ์์กด์ฑ ํ์ผ ๋ณต์ฌ ๋ฐ ์ค์น
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# ์์ค ์ฝ๋ ๋ฐ ๋ฐ์ดํฐ ๋ณต์ฌ
COPY . .
# ๊ถํ ์ค์ (Hugging Face Spaces๋ ๋น๋ฃจํธ ์ ์ ๋ก ์คํ๋ ์ ์์)
RUN chmod -R 777 /app
# (์ ํ) ๋ฐฐํฌ ์ ์ธ๋ฑ์ค๊ฐ ์๋ค๋ฉด ๋น๋ (data ํด๋๊ฐ ์์ด์ผ ํจ)
# RUN python scripts/build_index.py
# ํฌํธ ์ค์
EXPOSE 7860
# ์๋ฒ ์คํ ๋ช
๋ น
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--root-path", "${GRADIO_ROOT_PATH}"] |