Spaces:
Running
Running
Commit ·
287f048
1
Parent(s): 912f906
Move Dockerfile to root for Hugging Face detection
Browse files- Dockerfile +35 -0
Dockerfile
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.11-slim
|
| 2 |
+
|
| 3 |
+
# Create user to run the app
|
| 4 |
+
RUN useradd -m -u 1000 user
|
| 5 |
+
USER user
|
| 6 |
+
ENV HOME=/home/user \
|
| 7 |
+
PATH=/home/user/.local/bin:$PATH
|
| 8 |
+
|
| 9 |
+
WORKDIR $HOME/app
|
| 10 |
+
|
| 11 |
+
# Install system dependencies (e.g. for lightgbm/xgboost)
|
| 12 |
+
USER root
|
| 13 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 14 |
+
build-essential \
|
| 15 |
+
libgomp1 \
|
| 16 |
+
git \
|
| 17 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 18 |
+
USER user
|
| 19 |
+
|
| 20 |
+
# Copy the entire project to the container
|
| 21 |
+
COPY --chown=user . $HOME/app/
|
| 22 |
+
|
| 23 |
+
# Install python dependencies from the root requirements.txt
|
| 24 |
+
RUN pip install --no-cache-dir --upgrade pip
|
| 25 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 26 |
+
|
| 27 |
+
# Install SAP-RPT-1 OSS directly from GitHub (needed for the real model)
|
| 28 |
+
RUN pip install --no-cache-dir git+https://github.com/SAP-samples/sap-rpt-1-oss.git
|
| 29 |
+
|
| 30 |
+
# Expose port 7860 (Hugging Face Spaces default port)
|
| 31 |
+
EXPOSE 7860
|
| 32 |
+
|
| 33 |
+
# Run the app using the root app.py entry point
|
| 34 |
+
# This ensures all paths (matrix/, etc.) are correctly added to sys.path
|
| 35 |
+
CMD ["python", "app.py"]
|