Security added on delete service and list all node + cleaning some code
This commit is contained in:
@ -1,26 +1,20 @@
|
||||
# ---- Build Stage ----
|
||||
FROM debian:bookworm AS builder
|
||||
|
||||
# Install Rust and build tools
|
||||
RUN apt-get update && apt-get install -y curl build-essential pkg-config libssl-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install rustup (stable toolchain)
|
||||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||
ENV PATH="/root/.cargo/bin:${PATH}"
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Cache Rust dependencies
|
||||
COPY Cargo.toml Cargo.lock ./
|
||||
RUN mkdir src && echo "fn main() {}" > src/main.rs
|
||||
RUN cargo build --release || true
|
||||
|
||||
# Copy sources and build the real binary
|
||||
COPY . .
|
||||
RUN cargo build --release
|
||||
|
||||
# ---- Runtime Stage ----
|
||||
FROM debian:bookworm-slim
|
||||
|
||||
RUN apt-get update && apt-get install -y libssl3 procps iputils-ping curl \
|
||||
@ -28,10 +22,8 @@ RUN apt-get update && apt-get install -y libssl3 procps iputils-ping curl \
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy data file
|
||||
COPY processes.json /app/processes.json
|
||||
|
||||
# Copy compiled binary
|
||||
COPY --from=builder /app/target/release/node /usr/local/bin/node-service
|
||||
|
||||
EXPOSE 8081
|
||||
|
||||
Reference in New Issue
Block a user