Spaces:
Sleeping
Sleeping
File size: 1,035 Bytes
287f048 73d00fd 287f048 | 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 | FROM python:3.11-slim
# Create user to run the app
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH \
HF_HUB_ENABLE_HF_TRANSFER=1
WORKDIR $HOME/app
# Install system dependencies (e.g. for lightgbm/xgboost)
USER root
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libgomp1 \
git \
&& rm -rf /var/lib/apt/lists/*
USER user
# Copy the entire project to the container
COPY --chown=user . $HOME/app/
# Install python dependencies from the root requirements.txt
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
# Install SAP-RPT-1 OSS directly from GitHub (needed for the real model)
RUN pip install --no-cache-dir git+https://github.com/SAP-samples/sap-rpt-1-oss.git
# Expose port 7860 (Hugging Face Spaces default port)
EXPOSE 7860
# Run the app using the root app.py entry point
# This ensures all paths (matrix/, etc.) are correctly added to sys.path
CMD ["python", "app.py"]
|