-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (26 loc) · 1.32 KB
/
Dockerfile
File metadata and controls
38 lines (26 loc) · 1.32 KB
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
# Multi-stage Dockerfile for TensorDB server
# Build: docker build -t tensordb .
# Run: docker run -p 5433:5433 -v tensordb_data:/data tensordb
# ── Build stage ────────────────────────────────────────────────────────────
FROM rust:1.82-bookworm AS builder
WORKDIR /app
COPY . .
# Build server and CLI without LLM feature (smaller image)
RUN cargo build --release -p tensordb-server -p tensordb-cli --no-default-features \
&& strip target/release/tensordb-server target/release/tensordb-cli
# ── Runtime stage ──────────────────────────────────────────────────────────
FROM debian:bookworm-slim AS runtime
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/target/release/tensordb-server /usr/local/bin/
COPY --from=builder /app/target/release/tensordb-cli /usr/local/bin/
# Data directory
RUN mkdir -p /data
VOLUME /data
# PostgreSQL wire protocol port
EXPOSE 5433
ENV TENSORDB_DATA_DIR=/data
ENV TENSORDB_PORT=5433
ENTRYPOINT ["tensordb-server"]
CMD ["--data-dir", "/data", "--port", "5433"]