Spaces:
Running
Running
File size: 638 Bytes
157c265 4ecf2a3 157c265 4ecf2a3 157c265 |
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 |
FROM python:3.10
WORKDIR /app
# Install system dependencies (OpenCV, Glib, and other libraries)
RUN apt-get update && apt-get install -y \
libgl1-mesa-glx \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements and install
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Copy your FastAPI code and model
COPY app.py /app/
COPY model /app/model
COPY requirements.txt /app/
# Expose the default Spaces port
EXPOSE 7860
# Start FastAPI (using uvicorn)
ENV PORT 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|