Spaces:
Sleeping
Sleeping
Download Dockerfile from fdsafd4555/campus-rag-backend: direct link, hf CLI and curl.
- Browser
- Download file 765 Bytes
-
https://huggingface.co/spaces/fdsafd4555/campus-rag-backend/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/fdsafd4555/campus-rag-backend/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/fdsafd4555/campus-rag-backend/resolve/main/Dockerfile
765 Bytes
| FROM python:3.11-slim | |
| # 시스템 의존성 | |
| RUN apt-get update && apt-get install -y build-essential && rm -rf /var/lib/apt/lists/* | |
| # HF Spaces는 user로 실행해야 함 | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV PATH="/home/user/.local/bin:$PATH" | |
| WORKDIR /app | |
| # requirements 먼저 설치 (캐시 활용) | |
| COPY --chown=user requirements.txt . | |
| RUN pip install --no-cache-dir --upgrade pip && pip install --no-cache-dir -r requirements.txt | |
| # 앱 코드 복사 | |
| COPY --chown=user app/ ./app/ | |
| COPY --chown=user prompts/ ./prompts/ | |
| # HF Spaces 기본 포트는 7860 | |
| EXPOSE 7860 | |
| # 모델 캐시 디렉토리 (user의 home 안에) | |
| ENV HF_HOME=/home/user/.cache/huggingface | |
| # uvicorn 시작 | |
| CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"] | |