Skip to content
1        10        20        30        40        50        60        70        801# syntax=docker/dockerfile:123FROM rust:slim-bookworm AS builder45LABEL remote="silenloc/cairn"6LABEL ino.deploy.server="https://ino.silenlocatelli.ch"7LABEL ino.deploy.host="cairn.silenlocatelli.ch"89WORKDIR /app1011COPY Cargo.toml Cargo.lock ./12COPY src ./src1314# The cargo registry and target/ live in BuildKit cache mounts, so rebuilds reuse15# dependency artifacts. The binary is copied out inside the same step because16# target/ is not part of the image layer.17RUN --mount=type=cache,target=/usr/local/cargo/registry,sharing=locked \18    --mount=type=cache,target=/app/target,sharing=locked \19    cargo build --release --locked \20    && cp target/release/cairn /usr/local/bin/cairn2122FROM debian:bookworm-slim2324RUN apt-get update \25    && apt-get install -y --no-install-recommends ca-certificates \26    && rm -rf /var/lib/apt/lists/* \27    && useradd --system --home-dir /data --shell /usr/sbin/nologin cairn \28    && mkdir /data \29    && chown cairn:cairn /data3031COPY --from=builder /usr/local/bin/cairn /usr/local/bin/cairn3233# Listen on all interfaces inside the container; the proxy is the only way in.34ENV BIND_ADDRESS=0.0.0.0 \35    PORT=80 \36    DB_PATH=/data/cairn.db \37    RUST_LOG=info3839# Database and its WAL files live here; back this volume up.40VOLUME ["/data"]41EXPOSE 804243USER cairn44ENTRYPOINT ["cairn"]45CMD ["serve"]