git-next/Dockerfile
Paul Campbell cbf6c3b73c chore: lint fix for Dockerfile
>  2 warnings found (use --debug to expand):
> - FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 6)
> - FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line
11)
2024-07-05 07:46:45 +01:00

30 lines
877 B
Docker

# Leveraging the pre-built Docker images with
# cargo-chef and the Rust toolchain
FROM git.kemitix.net/kemitix/git-next-builder:latest AS chef
WORKDIR /app
FROM chef AS planner
COPY Cargo.toml ./
COPY crates crates
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
COPY --from=planner /app/recipe.json recipe.json
RUN cargo chef cook --profile release --recipe-path recipe.json
COPY . .
RUN cargo build --release --bin git-next && \
strip target/release/git-next
FROM docker.io/debian:stable-20240423-slim AS runtime
WORKDIR /app
RUN apt-get update && \
apt-get install --no-install-recommends -y \
git=1:2.39.2-1.1 \
libssl3=3.0.11-1~deb12u2 \
ca-certificates=20230311 \
&& \
rm -rf /var/lib/apt/lists/*
USER 1000
COPY --from=builder /app/target/release/git-next /usr/local/bin
ENTRYPOINT [ "/usr/local/bin/git-next", "server", "start" ]