2021-04-14 19:40:50 +02:00
|
|
|
FROM rust as builder
|
2021-04-13 23:31:41 +02:00
|
|
|
|
|
|
|
RUN rustup default nightly
|
|
|
|
|
2021-04-14 19:40:50 +02:00
|
|
|
|
|
|
|
RUN cargo new --bin atuin
|
2021-04-13 23:31:41 +02:00
|
|
|
WORKDIR /atuin
|
2021-04-14 19:40:50 +02:00
|
|
|
COPY ./Cargo.toml ./Cargo.toml
|
|
|
|
COPY ./Cargo.lock ./Cargo.lock
|
|
|
|
|
|
|
|
RUN cargo build --release
|
|
|
|
|
|
|
|
RUN rm src/*.rs
|
|
|
|
|
|
|
|
ADD . ./
|
2021-04-13 23:31:41 +02:00
|
|
|
|
2021-04-14 19:40:50 +02:00
|
|
|
RUN rm ./target/release/deps/atuin*
|
2021-04-13 23:31:41 +02:00
|
|
|
RUN cargo build --release
|
|
|
|
|
2021-04-14 19:40:50 +02:00
|
|
|
FROM debian:buster-slim
|
|
|
|
|
|
|
|
RUN apt-get update \
|
|
|
|
&& apt-get install -y ca-certificates tzdata libpq-dev \
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
EXPOSE 8888
|
|
|
|
|
|
|
|
ENV TZ=Etc/UTC
|
|
|
|
ENV RUST_LOG=info
|
|
|
|
ENV ATUIN_CONFIG=/config/config.toml
|
|
|
|
|
|
|
|
COPY --from=builder /atuin/target/release/atuin ./atuin
|
|
|
|
|
|
|
|
ENTRYPOINT ["./atuin"]
|