2024-04-07 16:20:04 +01:00
|
|
|
# Leveraging the pre-built Docker images with
|
|
|
|
# cargo-chef and the Rust toolchain
|
2024-08-04 09:42:36 +01:00
|
|
|
FROM git.kemitix.net/kemitix/git-next-builder:2024.08.04 AS chef
|
2024-04-07 16:20:04 +01:00
|
|
|
WORKDIR /app
|
|
|
|
|
2024-07-05 07:46:45 +01:00
|
|
|
FROM chef AS planner
|
2024-04-07 17:28:54 +01:00
|
|
|
COPY Cargo.toml ./
|
2024-05-12 18:35:47 +01:00
|
|
|
COPY crates crates
|
2024-04-07 16:20:04 +01:00
|
|
|
RUN cargo chef prepare --recipe-path recipe.json
|
|
|
|
|
2024-07-05 07:46:45 +01:00
|
|
|
FROM chef AS builder
|
2024-05-12 18:35:47 +01:00
|
|
|
COPY --from=planner /app/recipe.json recipe.json
|
|
|
|
RUN cargo chef cook --profile release --recipe-path recipe.json
|
|
|
|
COPY . .
|
2024-08-26 06:51:37 +01:00
|
|
|
RUN cargo build --release --bin git-next --all-features && \
|
2024-05-12 18:35:47 +01:00
|
|
|
strip target/release/git-next
|
2024-04-07 16:20:04 +01:00
|
|
|
|
2024-08-04 09:43:06 +01:00
|
|
|
FROM docker.io/debian:stable-20240722-slim AS runtime
|
2024-04-07 16:20:04 +01:00
|
|
|
WORKDIR /app
|
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install --no-install-recommends -y \
|
2024-05-13 21:01:44 +01:00
|
|
|
git=1:2.39.2-1.1 \
|
2024-07-05 07:58:53 +01:00
|
|
|
libssl3=3.0.13-1~deb12u1 \
|
2024-08-04 08:36:19 +01:00
|
|
|
libdbus-1-dev=1.14.10-1~deb12u1 \
|
2024-04-11 18:58:30 +01:00
|
|
|
ca-certificates=20230311 \
|
|
|
|
&& \
|
2024-04-07 16:20:04 +01:00
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
USER 1000
|
2024-05-12 18:35:47 +01:00
|
|
|
COPY --from=builder /app/target/release/git-next /usr/local/bin
|
2024-04-07 16:20:04 +01:00
|
|
|
|
2024-05-12 18:35:47 +01:00
|
|
|
ENTRYPOINT [ "/usr/local/bin/git-next", "server", "start" ]
|