Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
FROM rust:1.85-bookworm AS chef

WORKDIR /app

# System dependencies (for prost-build and rocksdb)
RUN apt-get update && apt-get install -y \
protobuf-compiler \
clang \
libclang-dev \
llvm-dev \
build-essential \
&& rm -rf /var/lib/apt/lists/*

RUN cargo install cargo-chef

# Planner Stage
FROM chef AS planner

COPY Cargo.toml Cargo.lock ./
COPY crates ./crates

RUN cargo chef prepare --recipe-path recipe.json

# Builder Stage
FROM chef AS builder

COPY --from=planner /app/recipe.json recipe.json

# Building only the dependencies
RUN cargo chef cook --release --recipe-path recipe.json

COPY Cargo.toml Cargo.lock ./
COPY crates ./crates

# Building the binary
RUN cargo build --release --bin server

# Runtime Stage
FROM debian:bookworm-slim

RUN apt-get update && apt-get install -y \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*

RUN useradd -m vortexdb

WORKDIR /app

RUN mkdir -p /data && chown -R vortexdb:vortexdb /data

COPY --from=builder /app/target/release/server /usr/local/bin/server

# Safe defualts
ENV HTTP_HOST=0.0.0.0
ENV HTTP_PORT=3000
ENV GRPC_HOST=0.0.0.0
ENV GRPC_PORT=50051
ENV STORAGE_TYPE=inmemory
ENV INDEX_TYPE=flat
ENV LOGGING=true
ENV DISABLE_HTTP=false

EXPOSE 3000
EXPOSE 50051

USER vortexdb

ENTRYPOINT ["server"]
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,45 @@ Interactive terminal user interface built with [Ratatui](https://github.com/rata
- Vector operations (insert, search, delete)
- Modal dialogs for user input

### Unified Server Startup

VortexDB offers a Dockerfile and a docker-compose for starting up the gRPC and HTTP servers
Steps to get the unified server running:
```
cp .env.example .env
```

The following env vars are important, and are required to be set by the user:
`GRPC_ROOT_PASSWORD`
`DIMENSION`
`DATA_PATH`

**NOTE**: `DATA_PATH` is the directory within the container where persistent data is stored


Setting of the following env vars is optional, as they fallback to safe defaults, but recommended:
| .env Var | Function | Safe Default |
| :--- | :--- | :--- |
| `HTTP_HOST` | Host IP for the HTTP Server | `0.0.0.0` |
| `HTTP_PORT` | Port for the HTTP Server | `3000` |
| `GRPC_HOST` | Host IP for the gRPC Server | `0.0.0.0` |
| `GRPC_PORT` | Port for the gRPC Server | `50051` |
| `STORAGE_TYPE` | Store `inmemory` \| `rocksdb` | `inmemory` |
| `INDEX_TYPE` | Type of Indexer: `flat` \| `kdtree` \| `hnsw` | `flat` |
| `LOGGING` | Enable logs | `true` |
| `DISABLE_HTTP` | Bool flag to run the HTTP Server | `false` |


**NOTE**: CLI flags (e.g. `docker compose run --env` ) take precedence over docker-compose environment values, which in turn override `.env` file variables.

Now you're all set up.

To run the unified server:
```
docker compose up
```



## Roadmap

Expand Down
35 changes: 35 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
services:
vortexdb:
image: vortexdb:latest
container_name: vortexdb
restart: unless-stopped

env_file:
- .env

environment:
HTTP_HOST: ${HTTP_HOST:-0.0.0.0}
HTTP_PORT: ${HTTP_PORT:-3000}
GRPC_HOST: ${GRPC_HOST:-0.0.0.0}
GRPC_PORT: ${GRPC_PORT:-50051}

STORAGE_TYPE: ${STORAGE_TYPE:-inmemory}
INDEX_TYPE: ${INDEX_TYPE:-flat}
LOGGING: ${LOGGING:-true}
DISABLE_HTTP: ${DISABLE_HTTP:-false}

# Required
GRPC_ROOT_PASSWORD: ${GRPC_ROOT_PASSWORD}
DIMENSION: ${DIMENSION}

DATA_PATH: /data

ports:
- "${HTTP_PORT:-3000}:3000"
- "${GRPC_PORT:-50051}:50051"

volumes:
- vortexdb_data:/data

volumes:
vortexdb_data: