summaryrefslogtreecommitdiff
path: root/Dockerfile
blob: 1a751d41be6ecbc7e6b87359abf6ae55b7a64853 (plain) (blame)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# ==============================================================================
# Makima Server — slim image (no LLM/STT/TTS models)
# ==============================================================================
# This builds the smallest viable Makima server image: the Rust binary plus
# the runtime tools the orchestrator needs. The Listen and Speak websocket
# endpoints will respond with "ML models not configured" — everything else
# (mesh, directives, files, repo CRUD) works normally.
#
# Use Dockerfile.full when you need STT (Parakeet), diarization (Sortformer),
# or TTS (Chatterbox) — that variant is ~5GB larger because it downloads the
# model weights at build time.
# ==============================================================================

# ---------- Builder stage ----------
FROM rust:1.91-bookworm AS builder

WORKDIR /app

RUN apt-get update && apt-get install -y \
    pkg-config \
    libssl-dev \
    && rm -rf /var/lib/apt/lists/*

# Copy workspace files. We deliberately do NOT copy `voices/` or any model
# data — the slim build doesn't ship them.
COPY Cargo.toml Cargo.lock ./
COPY makima ./makima
COPY vendor ./vendor
COPY tools/stt-client ./tools/stt-client

RUN cargo build --release --package makima --bin makima

# ---------- Runtime stage ----------
FROM debian:bookworm-slim

# Runtime deps — same as the daemon image. No python, no huggingface_hub,
# no model download script.
RUN apt-get update && apt-get install -y --no-install-recommends \
    ca-certificates \
    libssl3 \
    git \
    curl \
    openssh-client \
    jq \
    && rm -rf /var/lib/apt/lists/*

# GitHub CLI for orchestrator PR operations.
RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg \
        -o /usr/share/keyrings/githubcli-archive-keyring.gpg \
    && chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
    && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" \
        > /etc/apt/sources.list.d/github-cli.list \
    && apt-get update \
    && apt-get install -y --no-install-recommends gh \
    && rm -rf /var/lib/apt/lists/*

COPY --from=builder /app/target/release/makima /makima

# Embed daemon binary for the download endpoint (same binary, served as
# `/api/v1/daemons/binaries/...` to clients).
RUN mkdir -p /app/daemon-binaries \
    && cp /makima /app/daemon-binaries/makima-linux-x86_64
ENV DAEMON_BINARIES_DIR=/app/daemon-binaries

ENV PORT=8080
ENV RUST_LOG=makima=info,tower_http=info
# NOTE: PARAKEET_MODEL_DIR / SORTFORMER_MODEL_PATH / CHATTERBOX_MODEL_DIR are
# DELIBERATELY not set. The server will start without them and Listen/Speak
# will return "ML models not configured" if a client attempts to use them.

EXPOSE 8080

HEALTHCHECK --interval=30s --timeout=10s --start-period=15s --retries=3 \
    CMD curl -f http://localhost:${PORT}/api/v1/healthcheck || exit 1

CMD ["/makima", "server"]