Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down