FaceRecog_hf / Dockerfile
tjrlgns09's picture
.
02a7bf9
# Dockerfile
FROM python:3.10-slim
# ํ•„์š”ํ•œ ํŒจํ‚ค์ง€, ๊ฐœ๋ฐœ ๋„๊ตฌ ๋ฐ git ์„ค์น˜ (root ๊ถŒํ•œ)
RUN apt-get update && \
apt-get install -y tzdata build-essential libsm6 libxext6 libgl1 libglib2.0-0 git curl wget && \
ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime && \
echo "Asia/Seoul" > /etc/timezone && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
WORKDIR /app
COPY --chown=user ./requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# โœ… ์ค‘์š”: AdaFace ์ €์žฅ์†Œ ํด๋ก  ๋ฐ ๊ฐ€์ค‘์น˜ ๋ฏธ๋ฆฌ ๋‹ค์šด๋กœ๋“œ (์„œ๋ฒ„ ์‹œ์ž‘ ์†๋„ ์ตœ์ ํ™”)
RUN git clone https://github.com/mk-minchul/AdaFace.git /app/AdaFace
RUN python -c "from huggingface_hub import hf_hub_download; import shutil; cache_path = hf_hub_download(repo_id='VishalMishraTss/AdaFace', filename='adaface_ir101_webface12m.ckpt'); shutil.copy(cache_path, '/app/adaface_ir101_webface12m.ckpt')"
# ์ตœ์ข… ์•ฑ ์ฝ”๋“œ ๋ณต์‚ฌ
COPY --chown=user . /app
# ์„œ๋ฒ„ ์‹คํ–‰ ๋ช…๋ น (Hugging Face Spaces ๊ธฐ๋ณธ ํฌํŠธ 7860)
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]