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-09-13 18:59:35 +01:00
|
|
|
FROM docker.io/debian:stable-20240904-slim AS runtime
|
2024-04-07 16:20:04 +01:00
|
|
|
WORKDIR /app
|
|
|
|
RUN apt-get update && \
|
2024-09-13 18:59:35 +01:00
|
|
|
apt-get satisfy -y "git (>=2.39), libssl3 (>=3.0.14), libdbus-1-dev (>=1.14.10), ca-certificates (>=20230311)" \
|
2024-04-11 18:58:30 +01:00
|
|
|
&& \
|
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-09-12 18:49:16 +01:00
|
|
|
ENV HOME=/app
|
|
|
|
|
2024-09-03 20:08:40 +01:00
|
|
|
ENTRYPOINT [ "/usr/local/bin/git-next" ]
|
|
|
|
CMD [ "server", "start" ]
|