2024-05-23 23:53:11 +00:00
|
|
|
FROM lukemathwalker/cargo-chef:latest-rust-slim as chef
|
2024-01-22 05:31:08 +00:00
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
FROM chef AS planner
|
2024-05-24 01:43:39 +00:00
|
|
|
COPY . .
|
|
|
|
RUN cargo chef prepare --recipe-path recipe.json
|
2024-01-22 05:31:08 +00:00
|
|
|
|
|
|
|
FROM chef AS builder
|
2024-05-24 01:43:39 +00:00
|
|
|
COPY --from=planner /app/recipe.json recipe.json
|
|
|
|
RUN cargo chef cook --release --recipe-path recipe.json
|
2024-01-22 05:31:08 +00:00
|
|
|
COPY . .
|
|
|
|
RUN cargo build --release
|
|
|
|
|
2024-05-24 01:43:39 +00:00
|
|
|
FROM debian:bookworm-slim AS runtime
|
2024-01-22 05:31:08 +00:00
|
|
|
WORKDIR /app
|
2024-05-24 01:43:39 +00:00
|
|
|
COPY --from=builder /app/config.toml /usr/local/bin/config.toml
|
|
|
|
COPY --from=builder /app/target/release/metasearch2 /usr/local/bin/metasearch2
|
|
|
|
ARG CONFIG
|
|
|
|
ENV CONFIG=${CONFIG}
|
2024-01-22 05:31:08 +00:00
|
|
|
EXPOSE 28019
|
2024-05-24 01:43:39 +00:00
|
|
|
ENTRYPOINT /usr/local/bin/metasearch2 $CONFIG
|