# Ultra-minimal Dockerfile for HF Spaces FROM python:3.11-slim # Set working directory WORKDIR /app # Install only essential system packages (no build tools) RUN apt-get update && apt-get install -y --no-install-recommends \ curl \ && rm -rf /var/lib/apt/lists/* \ && apt-get clean # Create non-root user RUN useradd -m -u 1000 user # Switch to user USER user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH WORKDIR $HOME/app # Copy and install minimal requirements COPY --chown=user requirements.txt . RUN pip install --user --no-cache-dir -r requirements.txt # Copy application code COPY --chown=user . . # Expose port EXPOSE 7860 # Environment variables ENV GRADIO_SERVER_NAME="0.0.0.0" \ GRADIO_SERVER_PORT=7860 # Run the test application CMD ["python", "simple_test.py"]