very fast at protocol indexer with flexible filtering, xrpc queries, cursor-backed event stream, and more, built on fjall
rust
fjall
at-protocol
atproto
indexer
1# syntax=docker/dockerfile:1
2
3# --- stage 1: dependency recipe ---
4FROM rust:slim-bookworm AS chef
5RUN cargo install cargo-chef --locked
6WORKDIR /build
7
8# --- stage 2: compute recipe ---
9FROM chef AS planner
10COPY . .
11RUN cargo chef prepare --recipe-path recipe.json
12
13# --- stage 3: build ---
14FROM chef AS builder
15
16RUN apt-get update && apt-get install -y --no-install-recommends \
17 cmake \
18 make \
19 pkg-config \
20 && rm -rf /var/lib/apt/lists/*
21
22# build dependencies first (cached layer)
23COPY --from=planner /build/recipe.json recipe.json
24RUN cargo chef cook --release --recipe-path recipe.json
25
26# build the project
27COPY . .
28RUN cargo build --release
29
30# --- stage 4: runtime ---
31FROM debian:bookworm-slim
32
33RUN apt-get update && apt-get install -y --no-install-recommends \
34 ca-certificates \
35 && rm -rf /var/lib/apt/lists/*
36
37RUN useradd --system --no-create-home --shell /usr/sbin/nologin hydrant
38
39COPY --from=builder /build/target/release/hydrant /usr/local/bin/hydrant
40
41# data volume for the fjall database
42VOLUME ["/data"]
43WORKDIR /data
44
45ENV HYDRANT_DATABASE_PATH=/data/hydrant.db
46
47EXPOSE 3000
48
49USER hydrant
50
51ENTRYPOINT ["/usr/local/bin/hydrant"]