innovate / Dockerfile
omgy's picture
Create Dockerfile
c5d4ee6 verified
raw
history blame contribute delete
569 Bytes
# Use lightweight Python image
FROM python:3.10-slim
# Set working directory
WORKDIR /app
# Install system dependencies (needed for OpenCV)
RUN apt-get update && apt-get install -y \
libgl1 \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first (better caching)
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy all app files
COPY . .
# Expose port (HF Spaces uses 7860)
EXPOSE 7860
# Start FastAPI app
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]