aboutsummaryrefslogtreecommitdiffstats
path: root/crates/configuration/Dockerfile
blob: 9d32bc02101d3b08dc58c70e301d7bfecbb17dcf (plain)
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
FROM rust:1.89.0-slim AS builder

ARG FEATURES=""

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/configuration crates/configuration
COPY ./lib lib
COPY ./Cargo.toml .
COPY ./Cargo.lock .

RUN cargo fetch

COPY ./proto proto

RUN cargo build -F "${FEATURES}" --target x86_64-unknown-linux-musl --release

FROM scratch
COPY --from=builder /usr/src/app/target/x86_64-unknown-linux-musl/release/warden-config ./
CMD [ "./warden-config" ]