Files
qdrant/Dockerfile

48 lines
1.0 KiB
Docker

# Leveraging the pre-built Docker images with
# cargo-chef and the Rust toolchain
# https://www.lpalmieri.com/posts/fast-rust-docker-builds/
FROM lukemathwalker/cargo-chef:latest-rust-1.61.0 AS chef
WORKDIR /qdrant
FROM chef AS planner
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
FROM chef as builder
WORKDIR /qdrant
COPY --from=planner /qdrant/recipe.json recipe.json
RUN apt-get update ; apt-get install -y clang cmake ; rustup component add rustfmt
# Build dependencies - this is the caching Docker layer!
RUN cargo chef cook --release --recipe-path recipe.json
COPY . .
# Build actual target here
RUN cargo build --release --bin qdrant
FROM debian:11-slim
ARG APP=/qdrant
RUN apt-get update \
&& apt-get install -y ca-certificates tzdata \
&& rm -rf /var/lib/apt/lists/*
EXPOSE 6333
EXPOSE 6334
ENV TZ=Etc/UTC \
RUN_MODE=production
RUN mkdir -p ${APP}
COPY --from=builder /qdrant/target/release/qdrant ${APP}/qdrant
COPY --from=builder /qdrant/config ${APP}/config
WORKDIR ${APP}
CMD ["./qdrant"]