File size: 2,091 Bytes
8f6612b
 
 
 
 
 
e445d6f
8f6612b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e445d6f
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# ============================================================================
# MHRN — Dockerfile
# ============================================================================
# Multi-stage build for minimal production image.
#
# Build:    docker build -t mhrn .
# Run:      docker run --rm -p 8767:8767 mhrn
# Run with: docker run --rm -v ./configs:/app/configs mhrn \
#             python -m src.main --config configs/poc_config.yaml
# ============================================================================

# ---- Build stage -----------------------------------------------------------
FROM python:3.13-slim AS builder

WORKDIR /build

# Install build dependencies
RUN pip install --no-cache-dir build "setuptools>=68" wheel

# Copy package metadata and sources
COPY pyproject.toml setup.py README.md LICENSE ./
COPY src/ src/

# Build wheel
RUN python -m build --wheel --no-isolation

# ---- Runtime stage ---------------------------------------------------------
FROM python:3.13-slim

WORKDIR /app

# Install runtime dependencies only
RUN apt-get update && apt-get install -y --no-install-recommends \
    libgomp1 \
    && rm -rf /var/lib/apt/lists/*

# Copy built wheel from builder
COPY --from=builder /build/dist/*.whl /tmp/
RUN pip install --no-cache-dir /tmp/*.whl && rm /tmp/*.whl

# Copy source code (for editable imports)
COPY src/ src/
COPY configs/ configs/
COPY scripts/ scripts/
COPY research/ research/
COPY docs/ docs/
COPY project_identity.json NAMING.md README.md ./

# Public instrument bytes only; the response collector and private data stay separate.
COPY review_portal/catalogue.py review_portal/catalogue.py
RUN python -c "from pathlib import Path; from src.dashboard.external_review import build_external_review_status; status = build_external_review_status(Path('/app')); assert status['available'], status"

# Expose dashboard port
EXPOSE 8765

# Hugging Face Spaces starts the integrated dashboard from this command.
CMD ["python", "-m", "src.main", "--config", "configs/poc_config.yaml", "--dashboard-host", "0.0.0.0", "--dashboard-port", "8767"]