File size: 1,078 Bytes
3c898bc ca4393e 3c898bc ca4393e 3c898bc ca4393e c0a2f87 ca4393e c0a2f87 3c898bc | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | # Use a stable Python base image
FROM python:3.11-slim
# Set working directory
WORKDIR /app
# Upgrade pip
RUN pip install --no-cache-dir --upgrade pip
# Install system dependencies (minimal set for Streamlit/Gradio apps)
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
# Copy project files into container
COPY . /app
# Install Python dependencies
# CPU-only PyTorch avoids multi-GB CUDA downloads
RUN pip install --no-cache-dir \
datasets \
"huggingface-hub>=0.30" \
"hf-transfer>=0.1.4" \
"protobuf<4" \
"click<8.1" \
gradio[oauth,mcp]==6.13.0 \
"uvicorn>=0.14.0" \
"websockets>=10.4" \
spaces \
transformers==5.6.0 \
accelerate==1.13.0 \
--index-url https://download.pytorch.org/whl/cpu \
torch==2.11.0+cpu \
-r requirements.txt
# Expose default port for Streamlit
EXPOSE 7860
# Run your app (adjust filename if needed)
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|