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
# Dockerfile for volume server
FROM rust:1.82-slim AS builder
WORKDIR /app
# Install dependencies
RUN apt-get update && apt-get install -y \
build-essential \
pkg-config \
librocksdb-dev \
protobuf-compiler \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*
# Copy manifests
COPY Cargo.toml ./
COPY Cargo.lock* ./
RUN test -f Cargo.lock || cargo generate-lockfile
COPY build.rs ./
COPY proto ./proto
# Copy source
COPY src ./src
# Build volume binary
RUN cargo build --release --bin minikv-volume
# Runtime stage
FROM debian:bookworm-slim
WORKDIR /app
# Install runtime dependencies
RUN apt-get update && apt-get install -y \
ca-certificates \
curl \
librocksdb-dev \
&& rm -rf /var/lib/apt/lists/*
# Copy binary
COPY --from=builder /app/target/release/minikv-volume /usr/local/bin/minikv-volume
# Create data directories
RUN mkdir -p /data/blobs /data/wal
EXPOSE 6000 6001
# Healthcheck
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD curl -f http://localhost:6000/health || exit 1
# Entrypoint script
COPY scripts/volume-entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]