mekosotto Claude Opus 4.7 (1M context) commited on
Commit
fca5ceb
·
1 Parent(s): 3f6ac7b

deploy: alias Dockerfile.hf to Dockerfile for HF Spaces auto-discover

Browse files

Hugging 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>

Files changed (1) hide show
  1. Dockerfile +34 -19
Dockerfile CHANGED
@@ -1,30 +1,45 @@
1
- # NeuroBridge Enterprise — multi-stage build, FastAPI + pipeline runtime image.
2
- # Python 3.12 because RDKit / scikit-learn / numpy pins ship cp310-cp312 wheels only.
3
- FROM python:3.12-slim AS runtime
4
 
5
- # System deps required by RDKit (libxrender, libxext) and nibabel/MNE
6
- # (libgomp). Slim base lacks them.
 
 
 
 
 
 
 
 
 
7
  RUN apt-get update && apt-get install -y --no-install-recommends \
 
 
8
  libxrender1 \
 
9
  libxext6 \
10
- libgomp1 \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
  WORKDIR /app
14
 
15
- # Install dependencies first so the layer is cached when only source changes.
16
- COPY requirements.txt .
17
- RUN pip install --no-cache-dir -r requirements.txt
 
 
 
 
 
 
18
 
19
- COPY src/ src/
20
- COPY AGENTS.md README.md ./
 
21
 
22
- # Determinism env vars baked in (the pipelines re-pin defensively but
23
- # baking them avoids a brief race on container start).
24
- ENV OMP_NUM_THREADS=1 \
25
- OPENBLAS_NUM_THREADS=1 \
26
- MKL_NUM_THREADS=1 \
27
- PYTHONUNBUFFERED=1
28
 
29
- EXPOSE 8000
30
- CMD ["uvicorn", "src.api.main:app", "--host", "0.0.0.0", "--port", "8000"]
 
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"]