-
Notifications
You must be signed in to change notification settings - Fork 4
Add Dockerfile and docker-compose for unified server #60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| services: | ||
| vortexdb: | ||
Arshdeep54 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| build: . | ||
| 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: | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.