-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (21 loc) · 883 Bytes
/
Dockerfile
File metadata and controls
30 lines (21 loc) · 883 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:1.85-bookworm AS builder
RUN apt-get update && apt-get install -y \
cmake clang libclang-dev pkg-config libssl-dev \
# libboost-dev \ # was needed for floresta
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Cache dependencies: copy manifests first, build a dummy, then copy real source
COPY Cargo.toml Cargo.lock ./
RUN mkdir src && echo "fn main() {}" > src/main.rs && echo "" > src/lib.rs
RUN cargo build --release 2>/dev/null || true
RUN rm -rf src
# Now copy real source and build
COPY src/ src/
COPY tests/ tests/
RUN touch src/main.rs src/lib.rs && cargo build --release
# Runtime stage — minimal image
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/target/release/cltv-scan /usr/local/bin/cltv-scan
EXPOSE 3001
CMD ["cltv-scan", "serve", "-p", "3001"]