Skip to content

Commit e7c2a38

Browse files
authored
Add docker-compose file with instructions (#3)
* Add docker-compose file with instructions * Dockerfile: use correct CLI arguments * Fix syntax error * docker-compose: add semantic indexer
1 parent 0fd029b commit e7c2a38

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ RUN cargo build --release
66
FROM debian:bullseye-slim
77
WORKDIR /app
88
COPY --from=builder /usr/src/app/target/release/terminusdb-semantic-indexer /app/
9-
CMD ["./terminusdb-semantic-indexer", "serve", "/app/terminusdb/storage/db"]
9+
CMD ["./terminusdb-semantic-indexer", "serve", "--directory", "/app/terminusdb/storage/semantic_db"]

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,23 @@ You can compile the system with cargo:
2727
cargo compile --release
2828
```
2929

30+
## Running with docker-compose
31+
32+
Create a .env file with the following contents:
33+
34+
```
35+
OPENAI_KEY=YOUR_OPENAI_KEY
36+
BUFFER_AMOUNT=1200000
37+
```
38+
39+
The buffers are 12kb each, so this will roughly be ~1.2GB of memory.
40+
You can change this depending on your memory requirements.
41+
42+
After you created the ENV file, you can start the server by
43+
running `docker compose up` or `docker-compose up` depending
44+
on your docker-compose version. This will start a TerminusDB
45+
server on port 6363 and a VectorLink server on port 8080.
46+
3047
## Invoking
3148

3249
In order to invoke the server, you need to supply an OpenAI key. This

docker-compose.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
version: "3"
2+
3+
services:
4+
terminusdb:
5+
image: terminusdb/terminusdb-server:semantic_indexer
6+
container_name: terminusdb-server
7+
tty: true
8+
ports:
9+
- 6363:6363
10+
environment:
11+
- TERMINUSDB_SERVER_PORT=6363
12+
volumes:
13+
- ./storage:/app/terminusdb/storage
14+
semantic_indexer:
15+
build: .
16+
ports:
17+
- "8080:8080"
18+
environment:
19+
- TERMINUSDB_CONTENT_ENDPOINT=http://terminusdb:6363
20+
- OPENAI_KEY=${OPENAI_KEY}
21+
volumes:
22+
- ./vector_storage:/app/storage
23+
command: ["./terminusdb-semantic-indexer", "serve", "--directory", "/app/storage", "--size", "${BUFFER_AMOUNT}"]

0 commit comments

Comments
 (0)