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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Build stage
FROM rust:1.85-bookworm AS builder
# Install build dependencies for RocksDB
RUN apt-get update && apt-get install -y \
clang \
libclang-dev \
cmake \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy all workspace source files
COPY Cargo.toml Cargo.lock ./
COPY src ./src
COPY crates ./crates
COPY cli ./cli
COPY benches ./benches
COPY examples ./examples
# Build the application
ENV CXXFLAGS="-include cstdint"
RUN cargo build --release
# Runtime stage
FROM debian:bookworm-slim
LABEL org.opencontainers.image.source="https://github.com/fab679/graphmind"
LABEL org.opencontainers.image.description="Graphmind Graph Database"
LABEL org.opencontainers.image.licenses="Apache-2.0"
# Install runtime dependencies
RUN apt-get update && apt-get install -y \
ca-certificates \
libstdc++6 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy the binary from builder
COPY --from=builder /app/target/release/graphmind /usr/local/bin/graphmind
# Create data directory for persistence
RUN mkdir -p /data
# Expose RESP protocol port
EXPOSE 6379
# Expose Web Visualizer port
EXPOSE 8080
# Set environment variables
ENV RUST_LOG=info
# Healthcheck via RESP PING
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD echo "PING" | nc -w1 localhost 6379 | grep -q PONG || exit 1
# Run the server, binding to 0.0.0.0 so it's reachable from outside the container
ENTRYPOINT ["graphmind"]
CMD ["--host", "0.0.0.0"]