-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (23 loc) · 711 Bytes
/
Copy pathDockerfile
File metadata and controls
30 lines (23 loc) · 711 Bytes
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
FROM rust:slim AS builder
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
cmake \
libssl-dev \
pkg-config \
protobuf-compiler \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /src
COPY . .
RUN cargo build --release --bin mcb
FROM debian:bookworm-slim
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates libssl3 \
&& rm -rf /var/lib/apt/lists/* \
&& useradd --create-home --home-dir /home/mcb --shell /usr/sbin/nologin mcb
COPY --from=builder /src/target/release/mcb /usr/local/bin/mcb
USER mcb
WORKDIR /home/mcb
ENTRYPOINT ["mcb"]
CMD ["serve", "--stdio"]