diff options
| author | Ellie Huxtable <e@elm.sh> | 2021-04-20 21:53:07 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-20 20:53:07 +0000 |
| commit | a21737e2b7f8d1e426726bdd7536033f299d476a (patch) | |
| tree | e940afdff9c145d25d9a2895fd44a77d70719a2e /Dockerfile | |
| parent | Switch to Warp + SQLx, use async, switch to Rust stable (#36) (diff) | |
| download | atuin-a21737e2b7f8d1e426726bdd7536033f299d476a.zip | |
Use cargo workspaces (#37)
* Switch to Cargo workspaces
Breaking things into "client", "server" and "common" makes managing the
codebase much easier!
client - anything running on a user's machine for adding history
server - handles storing/syncing history and running a HTTP server
common - request/response API definitions, common utils, etc
* Update dockerfile
Diffstat (limited to 'Dockerfile')
| -rw-r--r-- | Dockerfile | 47 |
1 files changed, 19 insertions, 28 deletions
@@ -1,31 +1,22 @@ -FROM rust:1.51-buster as builder +FROM lukemathwalker/cargo-chef as planner +WORKDIR app +COPY . . +RUN cargo chef prepare --recipe-path recipe.json -RUN cargo new --bin atuin -WORKDIR /atuin -COPY ./Cargo.toml ./Cargo.toml -COPY ./Cargo.lock ./Cargo.lock +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 -RUN cargo build --release +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 -RUN rm src/*.rs - -ADD . ./ - -RUN rm ./target/release/deps/atuin* -RUN cargo build --release - -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"] +FROM debian:buster-slim as runtime +WORKDIR app +COPY --from=builder /app/target/release/atuin /usr/local/bin +ENTRYPOINT ["/usr/local/bin/atuin"] |
