API_Eval / Dockerfile
HarshitaSuri's picture
Create Dockerfile
26db2ca verified
raw
history blame contribute delete
800 Bytes
# Use a stable Python version with prebuilt wheels
FROM python:3.10-slim
# Set working directory
WORKDIR /app
# Install system dependencies needed for scientific stack and Gradio
RUN apt-get update && apt-get install -y \
git git-lfs ffmpeg libsm6 libxext6 libgl1 curl \
&& rm -rf /var/lib/apt/lists/* \
&& git lfs install
# Upgrade pip
RUN pip install --no-cache-dir --upgrade pip
# Install CPU-only PyTorch first (fast, avoids CUDA build)
RUN pip install --no-cache-dir torch==2.2.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
# Copy requirements and install the rest
COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Copy app code
COPY . /app
# Expose Gradio port
EXPOSE 7860
# Run your app
CMD ["python", "app.py"]