25 lines
526 B
Docker
25 lines
526 B
Docker
# ---- Build Stage ----
|
|
FROM rust:1.71.1-slim-bullseye as build
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
RUN apt update && apt install -y \
|
|
iputils-ping \
|
|
libpq-dev \
|
|
cmake \
|
|
pkg-config \
|
|
gcc \
|
|
g++ \
|
|
python3 \
|
|
libssl-dev \
|
|
protobuf-compiler \
|
|
git
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
WORKDIR /app
|
|
COPY . .
|
|
RUN cargo build --release
|
|
|
|
## ---- Production Stage ----
|
|
FROM debian:bookworm AS production
|
|
WORKDIR /app
|
|
COPY --from=build /app/target/release/server_metrics ./
|
|
CMD [ "./server_metrics" ]
|