FROM python:3.11-slim # Prevent Python from writing pyc files & enable logs instantly ENV PYTHONDONTWRITEBYTECODE=1 \ PYTHONUNBUFFERED=1 \ PORT=7860 # Set working directory WORKDIR /app # Install system deps (optional but useful) RUN apt-get update && apt-get install -y \ gcc \ curl \ && rm -rf /var/lib/apt/lists/* # Install Python deps COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy project COPY . . # Expose HF default port EXPOSE 7860 # Start app using Python directly CMD ["python", "-m", "app.main"]