Spaces:
Build error
Build error
File size: 1,153 Bytes
6273393 |
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 |
# Dockerfile
# Python slim ์ด๋ฏธ์ง๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ์ฌ์ฉ (์ฉ๋ ์ ๊ฐ)
FROM python:3.10-slim
# ํ์ํ ํ๊ฒฝ ๋ณ์ ์ค์
ENV PYTHONUNBUFFERED 1
ENV APP_HOME /app
WORKDIR $APP_HOME
# ์์คํ
ํจํค์ง ์ค์น: OpenCV๊ฐ ํ์๋ก ํ๋ ํจํค์ง
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libgl1-mesa-glx \
libsm6 \
libxext6 \
libxrender1 && \
rm -rf /var/lib/apt/lists/*
# requirements.txt ๋ณต์ฌ ๋ฐ ์ค์น
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
# ์ ํ๋ฆฌ์ผ์ด์
์ฝ๋ ๋ณต์ฌ
COPY app.py .
# ์ธ๋ฑ์ค ํ์ผ๋ค์ด ์์นํ 'data' ํด๋ ์์ฑ ๋ฐ ํ์ผ ๋ณต์ฌ
# FAISS ์ธ๋ฑ์ค ํ์ผ๊ณผ pickle ํ์ผ์ ๋ฏธ๋ฆฌ ์ด ํด๋์ ๋ฃ์ด์ผ ํฉ๋๋ค.
RUN mkdir -p data
# COPY ./data/faiss_index_v2.index data/
# COPY ./data/faiss_labels_v2.pkl data/
# (์ฃผ: ์์ ๋ ์ค์ ์ค์ ๋ก ์ธ๋ฑ์ค ํ์ผ์ repo์ ์ถ๊ฐํ ํ ์ฃผ์์ ํด์ ํด์ผ ํฉ๋๋ค.)
# FastAPI ์ฑ ์คํ (Hugging Face Spaces ๊ธฐ๋ณธ ํฌํธ 7860 ์ฌ์ฉ)
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |