File size: 1,655 Bytes
5e0b58b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# ============================================================================
# Brain-5D — Dockerfile
# ============================================================================
# Multi-stage build for minimal production image.
#
# Build:    docker build -t brain5d .
# Run:      docker run --rm -p 8765:8765 brain5d
# Run with: docker run --rm -v ./configs:/app/configs brain5d \
#             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 ./
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/

# 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", "8765"]