File size: 952 Bytes
665bb42 b72622e a7328ec 665bb42 a7328ec 665bb42 a7328ec 665bb42 b010b3f 665bb42 b010b3f 665bb42 a7328ec b72622e 665bb42 a7328ec 665bb42 b46be0b 665bb42 a7328ec 665bb42 a7328ec 665bb42 a7328ec |
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 |
# Use Python 3.10 for compatibility
FROM python:3.10-slim
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
libopenblas-dev \
libomp-dev \
&& rm -rf /var/lib/apt/lists/*
# Create writable directories
RUN mkdir -p /tmp/huggingface_cache /tmp/matplotlib \
&& chmod -R 777 /tmp/huggingface_cache /tmp/matplotlib
# Set cache environment variables
ENV HF_HOME=/tmp
ENV TRANSFORMERS_CACHE=/tmp
ENV MPLCONFIGDIR=/tmp
# Copy requirements file
COPY requirements.txt /app/requirements.txt
# Install dependencies
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
# Install PyTorch separately for compatibility
RUN pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
# Copy application files
COPY . /app
# Expose Flask app port
EXPOSE 7860
# Run the application
CMD ["python", "main.py"]
|