2025-01-16 18:21:11 -08:00
|
|
|
FROM rust:1.84.0 as build
|
2020-07-23 22:46:33 +02:00
|
|
|
ENV PKG_CONFIG_ALLOW_CROSS=1
|
|
|
|
|
|
|
|
|
|
WORKDIR /usr/src/labrinth
|
|
|
|
|
COPY . .
|
2025-03-01 20:53:43 -08:00
|
|
|
ENV SQLX_OFFLINE=true
|
|
|
|
|
COPY apps/labrinth/.sqlx/ .sqlx/
|
|
|
|
|
RUN cargo build --release --package labrinth
|
2024-10-16 16:07:24 -07:00
|
|
|
|
2020-07-23 22:46:33 +02:00
|
|
|
|
2024-11-11 18:31:06 -08:00
|
|
|
FROM debian:bookworm-slim
|
2021-11-14 16:27:33 -07:00
|
|
|
|
2024-10-18 17:00:36 -07:00
|
|
|
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
|
|
|
|
|
|
2021-11-14 16:27:33 -07:00
|
|
|
RUN apt-get update \
|
2025-03-06 00:40:27 +01:00
|
|
|
&& apt-get install -y --no-install-recommends ca-certificates openssl dumb-init \
|
|
|
|
|
&& apt-get clean \
|
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
2021-11-14 16:27:33 -07:00
|
|
|
|
|
|
|
|
RUN update-ca-certificates
|
|
|
|
|
|
2020-08-29 16:56:50 +02:00
|
|
|
COPY --from=build /usr/src/labrinth/target/release/labrinth /labrinth/labrinth
|
2025-03-01 20:53:43 -08:00
|
|
|
COPY --from=build /usr/src/labrinth/apps/labrinth/migrations/* /labrinth/migrations/
|
|
|
|
|
COPY --from=build /usr/src/labrinth/apps/labrinth/assets /labrinth/assets
|
2020-08-28 21:03:00 +02:00
|
|
|
WORKDIR /labrinth
|
2020-08-28 20:24:43 +02:00
|
|
|
|
2025-03-06 00:40:27 +01:00
|
|
|
ENTRYPOINT ["dumb-init", "--"]
|
|
|
|
|
CMD ["/labrinth/labrinth"]
|