Spaces:
Sleeping
Sleeping
File size: 770 Bytes
03aeff7 78c4adf 03aeff7 32cfbac c820738 03aeff7 78c4adf 99a6191 d58cf52 99a6191 d58cf52 e25df2a 99a6191 32cfbac 78c4adf 32cfbac 78c4adf 99a6191 03aeff7 32cfbac 03aeff7 99a6191 0c804f7 |
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 |
FROM python:3.9-slim
# Install system dependencies
RUN apt-get update && apt-get install -y \
libgl1 \
libglib2.0-0 \
ffmpeg \
tesseract-ocr \
poppler-utils \
&& rm -rf /var/lib/apt/lists/*
# Set environment variables to avoid permission issues
ENV MPLCONFIGDIR=/tmp/matplotlib
ENV YOLO_CONFIG_DIR=/tmp/Ultralytics
ENV XDG_CACHE_HOME=/tmp
ENV FONTCONFIG_PATH=/tmp
RUN mkdir -p /tmp/matplotlib /tmp/ultralytics /tmp/fontconfig
# Set working directory
WORKDIR /app
# Copy project files
COPY . .
# Install Python dependencies
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
# Expose Hugging Face Spaces default port
EXPOSE 7860
# Run FastAPI app with Uvicorn
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |