# Scribase Mail: one image, one binary (`mail-server`) plus the static dashboard. # Build from this directory (the standalone workspace), on the target arch: # docker build -t scribase-mailrs: . # Pure-rustls build: no OpenSSL, so the runtime needs only CA certificates. # Independent implementation, written without reference to useSend source. FROM rust:1-bookworm AS build WORKDIR /src COPY Cargo.toml Cargo.lock ./ COPY crates ./crates RUN cargo build --release --locked -p mail-server \ && strip target/release/mail-server FROM debian:bookworm-slim RUN apt-get update \ && apt-get install -y --no-install-recommends ca-certificates curl \ && rm -rf /var/lib/apt/lists/* \ && useradd --system --uid 10001 --home /app --shell /usr/sbin/nologin mailrs COPY --from=build /src/target/release/mail-server /usr/local/bin/mail-server COPY dashboard /app/dashboard # The mock API server is a dev tool; the binary never serves `mock/` anyway. RUN rm -rf /app/dashboard/mock && chown -R root:root /app && chmod -R a+rX /app ENV DASHBOARD_DIR=/app/dashboard \ BIND_ADDR=0.0.0.0:8790 EXPOSE 8790 USER mailrs ENTRYPOINT ["/usr/local/bin/mail-server"]