From 210fa67c5be862e870d1fe65a4036f5152b4ee82 Mon Sep 17 00:00:00 2001 From: Tamir Krief Date: Tue, 15 Jul 2025 17:48:00 -0400 Subject: [PATCH] feat: dockerfile and container setup added dockerfile to containerize csd tool on public container Resolves #36 --- Dockerfile | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..541e08e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,37 @@ +# ========== BUILD STAGE ========== +FROM rust:1.82.0 AS builder + +RUN apt-get update && apt-get install -y \ + python3 python3-pip python3-venv \ + libssl-dev pkg-config git && \ + rm -rf /var/lib/apt/lists/* + +WORKDIR /csd +COPY . . + +# Build the Rust core +RUN cargo build --release + +# ========== RUNTIME STAGE ========== +FROM debian:bookworm-slim + +RUN apt-get update && apt-get install -y \ + python3 python3-pip ca-certificates && \ + rm -rf /var/lib/apt/lists/* + +# Copy Rust binary +COPY --from=builder /csd/target/release/csd /usr/local/bin/csd + +# Copy Python plugins and dependencies +COPY --from=builder /csd/plugins/ /opt/csd/plugins/ + +WORKDIR /opt/csd + +# Install Python plugin requirements (if any) +# RUN if [ -f requirements.txt ]; then pip3 install --no-cache-dir -r requirements.txt; fi + +# Skip pip install because there’s no requirements file +RUN echo "No Python dependencies to install" + +ENTRYPOINT ["csd"] +CMD ["--help"]