-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcontrol.Dockerfile
More file actions
39 lines (29 loc) · 1.08 KB
/
control.Dockerfile
File metadata and controls
39 lines (29 loc) · 1.08 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
# Build: docker build -t roda-control -f control.Dockerfile .
# Run: docker run --rm -p 50051:50051 roda-control
FROM rust:1.95-slim-bookworm AS builder
RUN apt-get update && apt-get install -y --no-install-recommends \
protobuf-compiler \
pkg-config \
build-essential \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /src
COPY Cargo.toml Cargo.lock ./
COPY crates ./crates
COPY config.toml ./config.toml
RUN cargo build --release \
--package cluster --bin roda-server \
--package control --bin control
FROM debian:bookworm-slim AS runtime
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
tini \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Sibling layout: control's resolve_server_bin finds roda-server next
# to it without an env var.
COPY --from=builder /src/target/release/control /app/bin/control
COPY --from=builder /src/target/release/roda-server /app/bin/roda-server
EXPOSE 50051
# Override at runtime: RODA_CONTROL_ADDR, INITIAL_NODE_COUNT.
ENTRYPOINT ["/usr/bin/tini", "--", "/app/bin/control"]