2021-04-20 22:53:07 +02:00
|
|
|
FROM lukemathwalker/cargo-chef as planner
|
|
|
|
WORKDIR app
|
|
|
|
COPY . .
|
|
|
|
RUN cargo chef prepare --recipe-path recipe.json
|
|
|
|
|
|
|
|
FROM lukemathwalker/cargo-chef as cacher
|
|
|
|
WORKDIR app
|
|
|
|
COPY --from=planner /app/recipe.json recipe.json
|
|
|
|
RUN cargo chef cook --release --recipe-path recipe.json
|
|
|
|
|
|
|
|
FROM rust as builder
|
|
|
|
WORKDIR app
|
|
|
|
COPY . .
|
|
|
|
# Copy over the cached dependencies
|
|
|
|
COPY --from=cacher /app/target target
|
|
|
|
COPY --from=cacher $CARGO_HOME $CARGO_HOME
|
|
|
|
RUN cargo build --release --bin atuin
|
|
|
|
|
|
|
|
FROM debian:buster-slim as runtime
|
2021-04-21 19:13:51 +02:00
|
|
|
|
2021-04-20 22:53:07 +02:00
|
|
|
WORKDIR app
|
2021-04-21 19:13:51 +02:00
|
|
|
|
|
|
|
ENV TZ=Etc/UTC
|
2021-04-25 19:21:52 +02:00
|
|
|
ENV RUST_LOG=atuin::api=info
|
2021-04-21 19:13:51 +02:00
|
|
|
ENV ATUIN_CONFIG_DIR=/config
|
|
|
|
|
2021-04-20 22:53:07 +02:00
|
|
|
COPY --from=builder /app/target/release/atuin /usr/local/bin
|
|
|
|
ENTRYPOINT ["/usr/local/bin/atuin"]
|