-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
59 lines (43 loc) · 2.04 KB
/
Dockerfile
File metadata and controls
59 lines (43 loc) · 2.04 KB
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
59
# BigEd CC Fleet — Container Image
# Build: docker build -t biged-fleet .
# Run: docker run -p 5555:5555 -p 8080:8080 biged-fleet
# ── Stage 1: Rust builder ────────────────────────────────────────────
FROM rust:1.82-slim AS rust-builder
RUN apt-get update && apt-get install -y --no-install-recommends \
pkg-config libssl-dev python3-dev && \
rm -rf /var/lib/apt/lists/*
WORKDIR /build
# Copy Rust workspace (layer-cache Cargo files first for dep caching)
COPY biged-rs/Cargo.toml biged-rs/Cargo.lock ./
COPY biged-rs/src/ ./src/
COPY biged-rs/crates/ ./crates/
# Build release binaries: main biged binary (includes serve/supervisor/worker
# subcommands) plus the PyO3 bridge shared library
RUN cargo build --release -p biged-bridge -p biged-server -p biged-supervisor -p biged
# ── Stage 2: Python runtime ──────────────────────────────────────────
FROM python:3.12-slim
# System deps
RUN apt-get update && apt-get install -y --no-install-recommends \
openssl curl && \
rm -rf /var/lib/apt/lists/*
# Install uv for fast Python package management
RUN pip install --no-cache-dir uv
WORKDIR /app
# Copy compiled Rust artifacts from builder
COPY --from=rust-builder /build/target/release/biged /app/bin/biged
COPY --from=rust-builder /build/target/release/libbiged_bridge.so /app/biged_bridge.so
# Add Rust binaries to PATH
ENV PATH="/app/bin:${PATH}"
# Copy project files
COPY fleet/ ./fleet/
COPY BigEd/ ./BigEd/
COPY requirements*.txt ./
# Install Python dependencies
RUN if [ -f requirements.txt ]; then uv pip install --system -r requirements.txt; fi
# Ports: dashboard (5555) + web launcher (8080)
EXPOSE 5555 8080
# Healthcheck against dashboard API
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD curl -f http://localhost:5555/api/fleet/health || exit 1
# Default: start supervisor (which starts dashboard + workers)
CMD ["python", "fleet/supervisor.py"]