2022-08-24 02:08:26 +02:00
|
|
|
FROM rust:1.63 AS base
|
|
|
|
|
|
|
|
RUN cargo install cargo-chef
|
|
|
|
|
|
|
|
########################################################################
|
|
|
|
|
|
|
|
FROM base AS planner
|
|
|
|
|
|
|
|
WORKDIR /app/
|
|
|
|
COPY . .
|
|
|
|
RUN cargo chef prepare --recipe-path recipe.json
|
|
|
|
|
|
|
|
########################################################################
|
|
|
|
|
|
|
|
FROM base AS builder
|
|
|
|
|
|
|
|
COPY --from=planner /app/recipe.json ./recipe.json
|
|
|
|
RUN cargo chef cook --release --recipe-path recipe.json
|
|
|
|
|
2022-08-15 17:23:31 -07:00
|
|
|
COPY . .
|
|
|
|
RUN cargo build --package proxy --release
|
|
|
|
|
2022-08-24 02:08:26 +02:00
|
|
|
########################################################################
|
|
|
|
|
|
|
|
FROM debian:buster-slim AS runtime
|
|
|
|
|
2022-08-15 17:23:31 -07:00
|
|
|
COPY --from=builder ./target/release/proxy ./target/release/proxy
|
2022-08-24 02:08:26 +02:00
|
|
|
|
2022-08-18 20:23:31 +02:00
|
|
|
ENTRYPOINT ["/target/release/proxy"]
|