cloud / Dockerfile
dpv007's picture
Update Dockerfile
7da846e verified
raw
history blame
619 Bytes
# Use a small but recent base
FROM python:3.10-slim
# Allow apt installs for system deps (opencv needs libgl1, etc.)
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libgl1 \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy requirements first (for caching)
COPY requirements.txt .
# Install pip deps
RUN pip install --no-cache-dir -r requirements.txt
# Copy app code
COPY . .
# Expose the port Spaces expects by default
EXPOSE 7860
# Run uvicorn on port 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]