diff options
Diffstat (limited to 'crates/rule-executor/Dockerfile')
-rw-r--r-- | crates/rule-executor/Dockerfile | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/crates/rule-executor/Dockerfile b/crates/rule-executor/Dockerfile new file mode 100644 index 0000000..b7561d7 --- /dev/null +++ b/crates/rule-executor/Dockerfile @@ -0,0 +1,27 @@ +FROM rust:1.89.0-slim AS builder + +ENV SQLX_OFFLINE=true + +RUN rustup target add x86_64-unknown-linux-musl +RUN apt update && apt install -y musl-tools musl-dev protobuf-compiler curl +RUN update-ca-certificates + +WORKDIR /usr/src/app + +RUN mkdir -p crates + +COPY ./.sqlx .sqlx +COPY ./crates/rule-executor crates/rule-executor +COPY ./lib lib +COPY ./Cargo.toml . +COPY ./Cargo.lock . + +RUN cargo fetch + +COPY ./proto proto + +RUN cargo build --target x86_64-unknown-linux-musl --release + +FROM scratch +COPY --from=builder /usr/src/app/target/x86_64-unknown-linux-musl/release/rule-executor ./ +CMD [ "./rule-executor" ] |