deploy: alias Dockerfile.hf to Dockerfile for HF Spaces auto-discover
Browse filesHugging Face Spaces (Docker SDK) requires the build entry point at
./Dockerfile by convention. This is a literal copy of Dockerfile.hf
so the existing tests/deploy/test_dockerfile_hf.py contract still
inspects the canonical Dockerfile.hf source.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Dockerfile +34 -19
Dockerfile
CHANGED
|
@@ -1,30 +1,45 @@
|
|
| 1 |
-
# NeuroBridge Enterprise —
|
| 2 |
-
#
|
| 3 |
-
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
|
|
|
|
|
| 8 |
libxrender1 \
|
|
|
|
| 9 |
libxext6 \
|
| 10 |
-
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
WORKDIR /app
|
| 14 |
|
| 15 |
-
#
|
| 16 |
-
COPY requirements.txt .
|
| 17 |
-
RUN pip install -
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
-
|
| 20 |
-
|
|
|
|
| 21 |
|
| 22 |
-
#
|
| 23 |
-
|
| 24 |
-
ENV OMP_NUM_THREADS=1 \
|
| 25 |
-
OPENBLAS_NUM_THREADS=1 \
|
| 26 |
-
MKL_NUM_THREADS=1 \
|
| 27 |
-
PYTHONUNBUFFERED=1
|
| 28 |
|
| 29 |
-
|
| 30 |
-
CMD ["
|
|
|
|
| 1 |
+
# NeuroBridge Enterprise — Hugging Face Spaces deployment image
|
| 2 |
+
# Single container running FastAPI (port 8000) + Streamlit (port 7860).
|
| 3 |
+
# HF Spaces routes :7860 to the public URL automatically.
|
| 4 |
|
| 5 |
+
FROM python:3.12-slim AS base
|
| 6 |
+
|
| 7 |
+
ENV PYTHONDONTWRITEBYTECODE=1 \
|
| 8 |
+
PYTHONUNBUFFERED=1 \
|
| 9 |
+
PIP_DISABLE_PIP_VERSION_CHECK=1 \
|
| 10 |
+
PIP_NO_CACHE_DIR=1 \
|
| 11 |
+
DEPLOY_ENV=hf_spaces \
|
| 12 |
+
NEUROBRIDGE_DISABLE_MLFLOW=1 \
|
| 13 |
+
NEUROBRIDGE_DISABLE_LLM=1
|
| 14 |
+
|
| 15 |
+
# --- system deps for RDKit, nibabel, MNE ---
|
| 16 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 17 |
+
build-essential \
|
| 18 |
+
libgomp1 \
|
| 19 |
libxrender1 \
|
| 20 |
+
libsm6 \
|
| 21 |
libxext6 \
|
| 22 |
+
supervisor \
|
| 23 |
&& rm -rf /var/lib/apt/lists/*
|
| 24 |
|
| 25 |
WORKDIR /app
|
| 26 |
|
| 27 |
+
# --- Python deps ---
|
| 28 |
+
COPY requirements.txt ./
|
| 29 |
+
RUN pip install -r requirements.txt
|
| 30 |
+
|
| 31 |
+
# --- project source ---
|
| 32 |
+
COPY src/ ./src/
|
| 33 |
+
COPY tests/fixtures/ ./tests/fixtures/
|
| 34 |
+
COPY data/raw/ ./data/raw/
|
| 35 |
+
COPY supervisord.conf ./supervisord.conf
|
| 36 |
|
| 37 |
+
# --- build BBB model artifact at image-build time ---
|
| 38 |
+
# This makes the first /predict/bbb call instant on cold start.
|
| 39 |
+
RUN python -m src.models.bbb_model
|
| 40 |
|
| 41 |
+
# --- HF Spaces convention ---
|
| 42 |
+
EXPOSE 7860
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
+
# --- launch FastAPI + Streamlit under supervisord ---
|
| 45 |
+
CMD ["supervisord", "-n", "-c", "/app/supervisord.conf"]
|