docuflow / Dockerfile
woongmin's picture
[Delta-02] PyTorch CPU 버전 설치 (HF Spaces cpu-basic 환경)
567fa71
Raw History Blame Contribute Delete
680 Bytes
FROM python:3.11-slim
WORKDIR /app
# 시스템 의존성 설치
RUN apt-get update && apt-get install -y \
gcc \
postgresql-client \
&& rm -rf /var/lib/apt/lists/*
# Python 의존성 설치
COPY Pipfile Pipfile.lock ./
RUN pip install pipenv && \
pipenv run pip install torch --index-url https://download.pytorch.org/whl/cpu && \
pipenv install --deploy --ignore-pipfile
# 애플리케이션 코드 복사
COPY . .
# 업로드 디렉토리 생성
RUN mkdir -p app/uploads
# 환경 변수 설정
ENV PYTHONUNBUFFERED=1
# HF Spaces는 포트 7860 사용
EXPOSE 7860
CMD ["pipenv", "run", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]