Spaces:
Sleeping
Sleeping
| FROM python:3.10-slim | |
| WORKDIR /app | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| wget \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Install PyTorch CPU version first | |
| RUN pip install --no-cache-dir torch==2.0.1 --index-url https://download.pytorch.org/whl/cpu | |
| # Download and install mxfold2 wheel directly | |
| RUN wget -q https://github.com/mxfold/mxfold2/releases/download/v0.1.2/mxfold2-0.1.2-cp310-cp310-manylinux_2_17_x86_64.whl \ | |
| && pip install --no-cache-dir mxfold2-0.1.2-cp310-cp310-manylinux_2_17_x86_64.whl \ | |
| && rm mxfold2-0.1.2-cp310-cp310-manylinux_2_17_x86_64.whl | |
| # Install Gradio 5.x with compatible huggingface_hub | |
| RUN pip install --no-cache-dir \ | |
| gradio==5.9.1 \ | |
| numpy==1.24.4 \ | |
| tqdm==4.66.5 | |
| # Verify mxfold2 installation | |
| RUN which mxfold2 && mxfold2 --help | head -5 | |
| # Create non-root user for HF Spaces | |
| RUN useradd -m -u 1000 user | |
| # Copy application | |
| COPY app.py /app/app.py | |
| # Set ownership | |
| RUN chown -R user:user /app | |
| USER user | |
| # Set environment variables | |
| ENV HOME=/home/user \ | |
| PATH=/usr/local/bin:$PATH \ | |
| CUDA_VISIBLE_DEVICES="" | |
| WORKDIR /app | |
| EXPOSE 7860 | |
| CMD ["python", "app.py"] | |