Rename all project references from quicproquo/qpq to quicprochat/qpc across documentation, Docker configuration, CI workflows, packaging scripts, operational configs, and build tooling. - Docker: crate paths, binary names, user/group, data dirs, env vars - CI: workflow crate references, binary names, artifact names - Docs: all markdown files under docs/, SDK READMEs, book.toml - Packaging: OpenWrt Makefile, init script, UCI config (file renames) - Scripts: justfile, dev-shell, screenshot, cross-compile, ai_team - Operations: Prometheus config, alert rules, Grafana dashboard - Config: .env.example (QPQ_* → QPC_*), CODEOWNERS paths - Top-level: README, CONTRIBUTING, ROADMAP, CLAUDE.md
72 lines
3.0 KiB
Docker
72 lines
3.0 KiB
Docker
# ── Stage 1: Builder ──────────────────────────────────────────────────────────
|
|
#
|
|
# Uses the official Rust image on Debian Bookworm.
|
|
# capnproto is installed here because build.rs invokes `capnp` at compile time.
|
|
FROM rust:bookworm AS builder
|
|
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends capnproto \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /build
|
|
|
|
# Copy manifests first so dependency layers are cached independently of source.
|
|
COPY Cargo.toml Cargo.lock ./
|
|
COPY crates/quicprochat-core/Cargo.toml crates/quicprochat-core/Cargo.toml
|
|
COPY crates/quicprochat-proto/Cargo.toml crates/quicprochat-proto/Cargo.toml
|
|
COPY crates/quicprochat-server/Cargo.toml crates/quicprochat-server/Cargo.toml
|
|
COPY crates/quicprochat-client/Cargo.toml crates/quicprochat-client/Cargo.toml
|
|
COPY crates/quicprochat-p2p/Cargo.toml crates/quicprochat-p2p/Cargo.toml
|
|
|
|
# Create dummy source files so `cargo build` can resolve the dependency graph
|
|
# and cache the compiled dependencies before copying real source.
|
|
RUN mkdir -p \
|
|
crates/quicprochat-core/src \
|
|
crates/quicprochat-proto/src \
|
|
crates/quicprochat-server/src \
|
|
crates/quicprochat-client/src \
|
|
crates/quicprochat-p2p/src \
|
|
&& echo 'fn main() {}' > crates/quicprochat-server/src/main.rs \
|
|
&& echo 'fn main() {}' > crates/quicprochat-client/src/main.rs \
|
|
&& touch crates/quicprochat-core/src/lib.rs \
|
|
&& touch crates/quicprochat-proto/src/lib.rs \
|
|
&& touch crates/quicprochat-p2p/src/lib.rs
|
|
|
|
# Schemas must exist before the proto crate's build.rs runs.
|
|
COPY schemas/ schemas/
|
|
|
|
# Build dependencies only (source stubs mean this layer is cache-friendly).
|
|
# The GUI crate is not included, so workspace resolution may fail — || true handles it.
|
|
RUN cargo build --release --bin qpc-server --bin qpc 2>/dev/null || true
|
|
|
|
# Copy real source and build for real.
|
|
COPY crates/ crates/
|
|
|
|
# Touch source to force re-compilation after copying real crates.
|
|
RUN touch \
|
|
crates/quicprochat-core/src/lib.rs \
|
|
crates/quicprochat-proto/src/lib.rs \
|
|
crates/quicprochat-p2p/src/lib.rs \
|
|
crates/quicprochat-server/src/main.rs \
|
|
crates/quicprochat-client/src/main.rs
|
|
|
|
RUN cargo build --release --bin qpc-server --bin qpc
|
|
|
|
# ── Stage 2: Runtime ──────────────────────────────────────────────────────────
|
|
#
|
|
# Minimal Debian Bookworm image with both server and client binaries.
|
|
FROM debian:bookworm-slim AS runtime
|
|
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends ca-certificates \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY --from=builder /build/target/release/qpc-server /usr/local/bin/qpc-server
|
|
COPY --from=builder /build/target/release/qpc /usr/local/bin/qpc
|
|
|
|
RUN mkdir -p /chat
|
|
|
|
EXPOSE 7000
|
|
|
|
ENV RUST_LOG=info
|