mirror of
https://github.com/mayanayza/netvisor.git
synced 2025-12-10 08:24:08 -06:00
28 lines
724 B
Docker
28 lines
724 B
Docker
FROM lukemathwalker/cargo-chef:latest-rust-1.90 AS chef
|
|
WORKDIR /app
|
|
|
|
FROM chef AS planner
|
|
COPY . .
|
|
RUN cargo chef prepare --recipe-path recipe.json
|
|
|
|
FROM chef AS builder
|
|
COPY --from=planner /app/recipe.json recipe.json
|
|
# Build dependencies only (not the final binary)
|
|
RUN cargo chef cook --recipe-path recipe.json
|
|
|
|
FROM rust:1.90-bookworm AS runtime
|
|
RUN apt-get update && apt-get install -y \
|
|
ca-certificates \
|
|
curl \
|
|
iproute2 \
|
|
iputils-ping \
|
|
net-tools \
|
|
procps \
|
|
tcpdump \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
|
|
EXPOSE 60072 60073
|
|
|
|
CMD ["sh", "-c", "mkdir -p /data && touch /data/netvisor.db && mkdir -p /data/daemon-config/ && touch /data/daemon-config/ && cargo run --bin server"] |