diff --git a/Dockerfile b/Dockerfile index c2ff68f..78086d5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,12 +4,25 @@ FROM python:3.10-slim # Set the working directory in the container to /app WORKDIR /app -# Copy the local directory contents into the container -COPY . . +# Install system dependencies needed for building wheels (gcc, build-essential, python headers) +RUN apt-get update && apt-get install -y \ + gcc \ + build-essential \ + python3-dev \ + && rm -rf /var/lib/apt/lists/* + +# Copy only requirements first to leverage Docker cache +COPY requirements.txt . + +# Upgrade pip (recommended to avoid build issues) +RUN pip install --upgrade pip # Install Python dependencies RUN pip install --no-cache-dir -r requirements.txt +# Copy the rest of the application +COPY . . + # Expose port 7860 to access the app EXPOSE 7860 ENV GRADIO_SERVER_NAME="0.0.0.0"