Spaces:
Configuration error
Configuration error
File size: 725 Bytes
91967e7 | 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 34 35 36 | # Use a lightweight Python image
FROM python:3.9-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV PORT=7860
# Install system dependencies (OpenCV needs them)
RUN apt-get update && apt-get install -y \
build-essential \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender-dev \
ffmpeg \
&& rm -rf /var/lib/apt/lists/*
# Create working directory
WORKDIR /app
# Copy dependencies file first (better Docker caching)
COPY requirement.txt .
# Install Python dependencies
RUN pip install --upgrade pip && pip install -r requirement.txt
# Copy all project files
COPY . .
# Expose port for Hugging Face Spaces
EXPOSE $PORT
# Run your app
CMD ["python", "app.py"]
|