-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
31 lines (28 loc) · 938 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Planner
FROM rust as planner
WORKDIR /usr/src/app
RUN cargo install cargo-chef
COPY Cargo.toml Cargo.lock .cargo user_agents config.toml /usr/src/app/
COPY src/ /usr/src/app/src/
COPY containers/ /usr/src/app/containers/
RUN cargo chef prepare --recipe-path recipe.json
# Cacher
FROM rust as cacher
WORKDIR /usr/src/app
RUN cargo install cargo-chef
COPY --from=planner /usr/src/app/recipe.json recipe.json
RUN cargo chef cook --release --recipe-path recipe.json
# Builder
FROM rust as builder
WORKDIR /usr/src/app
COPY Cargo.toml Cargo.lock .cargo user_agents config.toml /usr/src/app/
COPY src/ /usr/src/app/src/
COPY containers/ /usr/src/app/containers/
# Copy over the cached dependencies
COPY --from=cacher /usr/src/app/target target
RUN cargo build --release
# Runtime
FROM rust as runtime
WORKDIR /usr/src/app
COPY --from=builder /usr/src/app/target/release/bellissimo /usr/local/bin
ENTRYPOINT ["/usr/local/bin/bellissimo"]