We standarized on using `rustls` as a TLS implementation across the monorepo, which is written in Rust and has better ergonomics, integration with the Rust ecosystem, and consistent behavior among platforms. However, the Labrinth Clickhouse client was the last remaining exception to this, using the native, OS-provided TLS implementation, which on Linux is OpenSSL and requires developers and Docker images to install OpenSSL development packages to build Labrinth, in addition to introducing an additional runtime dependency to Labrinth. Let's make the process of building Labrinth slightly simpler by switching such client to `rustls` as well, which results in finally using the same TLS implementation for everything, a simplified build and distribution process, less transitive dependencies, and potentially smaller binaries (since `rustls` was already being pulled in for, e.g., the SMTP client).
24 lines
783 B
Docker
24 lines
783 B
Docker
FROM rust:1.88.0 AS build
|
|
|
|
WORKDIR /usr/src/labrinth
|
|
COPY . .
|
|
RUN SQLX_OFFLINE=true cargo build --release --package labrinth
|
|
|
|
FROM debian:bookworm-slim
|
|
|
|
LABEL org.opencontainers.image.source=https://github.com/modrinth/code
|
|
LABEL org.opencontainers.image.description="Modrinth API"
|
|
LABEL org.opencontainers.image.licenses=AGPL-3.0
|
|
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends ca-certificates dumb-init curl \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY --from=build /usr/src/labrinth/target/release/labrinth /labrinth/labrinth
|
|
COPY --from=build /usr/src/labrinth/apps/labrinth/migrations/* /labrinth/migrations/
|
|
COPY --from=build /usr/src/labrinth/apps/labrinth/assets /labrinth/assets
|
|
WORKDIR /labrinth
|
|
|
|
ENTRYPOINT ["dumb-init", "--"]
|
|
CMD ["/labrinth/labrinth"]
|