-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (31 loc) · 1.06 KB
/
Copy pathDockerfile
File metadata and controls
39 lines (31 loc) · 1.06 KB
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
30
31
32
33
34
35
36
37
38
39
FROM rust:1.91-slim-bookworm AS base
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -qq && apt-get install -y git ca-certificates build-essential pkg-config libssl-dev
RUN cargo install sccache --version ^0.7
RUN cargo install cargo-chef --version ^0.1
ENV RUSTC_WRAPPER=sccache SCCACHE_DIR=/sccache
FROM base AS planner
WORKDIR /app
COPY . .
RUN --mount=type=cache,target=$SCCACHE_DIR,sharing=locked \
cargo chef prepare --recipe-path recipe.json
FROM base AS builder
WORKDIR /app
COPY --from=planner /app/recipe.json recipe.json
RUN --mount=type=cache,target=$SCCACHE_DIR,sharing=locked \
cargo chef cook --release --recipe-path recipe.json
COPY . .
RUN --mount=type=cache,target=$SCCACHE_DIR,sharing=locked \
cargo build --release
### Dist image
FROM gcr.io/distroless/cc-debian12 AS dist
COPY --from=builder /app/target/release/stigmerge /usr/bin/stigmerge
ENV RUST_LOG="veilid_core=error,stigmerge=debug"
ENV NO_UI=true
VOLUME /state
ENV STATE_DIR=/state
VOLUME /data
WORKDIR /data
EXPOSE 5150
ENV NODE_ADDR=":5150"
ENTRYPOINT ["/usr/bin/stigmerge"]