# Base image with Python FROM python:3.12 #Create a user to avoid running as root RUN useradd -m -u 1000 user USER user # Set environment variables ENV PATH="/home/user/.local/bin:$PATH" # Set working directory WORKDIR /app # Install system dependencies if needed RUN apt-get update && apt-get install -y \ build-essential \ python3-dev \ && rm -rf /var/lib/apt/lists/* # Copy requirements COPY requirements.txt . # Install Python dependencies RUN pip install --no-cache-dir -r requirements.txt # Copy app files COPY . . # Expose Hugging Face Spaces port EXPOSE 7860 # Run the Gradio app CMD ["python", "app.py"]