# syntax=docker/dockerfile:1 # The client is static; Nuxt generate leaves .output/public. FROM node:22-bookworm-slim AS web WORKDIR /app/web RUN npm install --global pnpm@11.22.0 COPY web/package.json web/pnpm-lock.yaml web/pnpm-workspace.yaml ./ RUN pnpm install --frozen-lockfile COPY web/ ./ RUN pnpm build # The server depends on the Rhema crates by version. Cargo.lock pins # them, so an image does not move when the framework's main branch does. FROM rust:1.98.1-bookworm AS server RUN apt-get update \ && apt-get install -y --no-install-recommends ca-certificates cmake pkg-config \ && rm -rf /var/lib/apt/lists/* WORKDIR /app COPY Cargo.toml Cargo.lock ./ COPY src ./src RUN cargo build --release FROM debian:bookworm-slim RUN apt-get update \ && apt-get install -y --no-install-recommends ca-certificates \ && rm -rf /var/lib/apt/lists/* \ && groupadd --gid 10001 together \ && useradd --uid 10001 --gid 10001 --home-dir /data --shell /usr/sbin/nologin --no-create-home together \ && install -d -o together -g together /data WORKDIR /app COPY --from=server /app/target/release/rhema-together /app/rhema-together COPY --from=web /app/web/.output/public /app/web ENV TOGETHER_LISTEN=0.0.0.0:7800 \ TOGETHER_DATABASE=/data/together.db \ TOGETHER_SECRET_KEY_FILE=/data/secret.key \ TOGETHER_WEB_DIR=/app/web \ HOME=/data \ RUST_LOG=rhema_together=info,tower_http=warn USER 10001:10001 VOLUME ["/data"] EXPOSE 7800 ENTRYPOINT ["/app/rhema-together"]