Spaces:
Paused
Paused
File size: 1,203 Bytes
6c3702d 10c5c90 6c3702d 10c5c90 6c3702d 10c5c90 6c3702d 10c5c90 6c3702d 10c5c90 6c3702d ad99874 6c3702d 10c5c90 6c3702d 10c5c90 6c3702d 10c5c90 6c3702d f1f455b 10c5c90 6c3702d | 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 43 44 45 46 | # CPU-optimized base image
FROM python:3.10-slim
# Set working directory
WORKDIR /app
# Install system dependencies (FIXED package names for newer Debian)
RUN apt-get update && apt-get install -y \
git \
wget \
libgl1 \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender1 \
libgomp1 \
libgthread-2.0-0 \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first
COPY requirements.txt .
# Install Python dependencies in order (CPU versions)
RUN pip install --no-cache-dir numpy==1.26.4 && \
pip install --no-cache-dir scipy==1.11.4 && \
pip install --no-cache-dir scikit-learn==1.3.2 && \
pip install --no-cache-dir matplotlib==3.7.2 && \
pip install --no-cache-dir torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cu118 && \
pip install --no-cache-dir -r requirements.txt
# Copy application
COPY . .
# Expose port
EXPOSE 7860
# Environment variables
ENV GRADIO_SERVER_NAME=0.0.0.0
ENV GRADIO_SERVER_PORT=7860
# Set cache directory to writable location
ENV HF_HOME=/tmp/huggingface
ENV TRANSFORMERS_CACHE=/tmp/huggingface
ENV HF_DATASETS_CACHE=/tmp/huggingface
# Run app
CMD ["python", "app.py"] |