2024-04-07 16:20:04 +01:00
|
|
|
# Leveraging the pre-built Docker images with
|
|
|
|
# cargo-chef and the Rust toolchain
|
2025-01-16 10:02:30 +00:00
|
|
|
FROM git.kemitix.net/kemitix/rust:v4.0.1 AS chef
|
2024-04-07 16:20:04 +01:00
|
|
|
WORKDIR /app
|
2025-01-16 19:24:44 +00:00
|
|
|
RUN apk add --no-cache dbus-dev=1.14.10-r4 && rm -rf /vra/cache/apk/*
|
2024-04-07 16:20:04 +01:00
|
|
|
|
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 . .
|
2025-01-16 19:24:44 +00:00
|
|
|
RUN cargo build --release --bin git-next --all-features && strip target/release/git-next
|
2024-04-07 16:20:04 +01:00
|
|
|
|
2025-01-16 19:24:44 +00:00
|
|
|
FROM chef AS runtime
|
2024-04-07 16:20:04 +01:00
|
|
|
WORKDIR /app
|
|
|
|
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" ]
|