Spaces:
Build error
Build error
#PYHON VSERSION | |
FROM python:3.8 | |
# Install required system dependencies | |
RUN apt-get update && apt-get install -y libopenblas-dev git curl && rm -rf /var/lib/apt/lists/* | |
# Fix distutils / setuptools wheel build issue | |
RUN apt-get update && apt-get install -y python3-distutils | |
RUN pip install --upgrade pip | |
RUN pip install "setuptools<66.0.0" | |
ENV SETUPTOOLS_USE_DISTUTILS=stdlib | |
# Set environment variables to avoid cache write errors | |
ENV HF_HOME=/app/hf_cache | |
ENV NUMBA_CACHE_DIR=/app/numba_cache | |
ENV NUMBA_DISABLE_CACHING=1 | |
# Set the working directory inside the container | |
WORKDIR /app | |
# Copy the requirements file into the container | |
COPY requirements.txt . | |
# Install dependencies | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Create necessary directories | |
RUN mkdir -p /app/modelsBioembed /app/models_folder /app/Samples /app/numba_cache /app/hf_cache | |
# Copy the entire project to the container | |
COPY . . | |
# Expose the port for Gunicorn | |
EXPOSE 7860 | |
# Run the app with Gunicorn | |
CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"] | |