-
Notifications
You must be signed in to change notification settings - Fork 0
Running RAGit using docker
This documentation provides instructions for deploying a standalone RAGIT application using Docker.
-
Create a new directory in any location you prefer where you will store all necessary files for deployment.
-
Under this directory create a file named
docker-compose.yamlwith the following content:
version: "3.8"
services:
frontend:
image: adaptaware/ragit:1.0
environment:
- OPENAI_API_KEY=${OPENAI_API_KEY}
- SERVICE_PORT=${INTERNAL_FRONT_END_PORT}
- RAG_COLLECTION=${RAG_COLLECTION}
- VECTOR_DB_PROVIDER=${VECTOR_DB_PROVIDER}
volumes:
- ${SHARED_DIR}:/root/ragit-data
ports:
- "${EXTERNAL_FRONT_END_PORT}:${INTERNAL_FRONT_END_PORT}"
backend:
image: adaptaware/ragit-back-end:1.0
environment:
- OPENAI_API_KEY=${OPENAI_API_KEY}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_PORT=${POSTGRES_PORT}
- POSTGRES_HOST=${POSTGRES_HOST}
- VECTOR_DB_PROVIDER=${VECTOR_DB_PROVIDER}
volumes:
- ${SHARED_DIR}:/root/ragit-data
stdin_open: true # Keep stdin open even if not attached
tty: true # Allocate a pseudo-TTY
db_host:
image: postgres:latest
environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_PORT=${POSTGRES_PORT}
- POSTGRES_HOST=${POSTGRES_HOST}
volumes:
- pgdata:/var/lib/postgresql/data
volumes:
pgdata:
-
In the directory containing
docker-compose.yaml, create a file named.envwith the following content:OPENAI_API_KEY=<valid-api-key> BIND_ADDRESS=0.0.0.0 EXTERNAL_FRONT_END_PORT=13133 INTERNAL_FRONT_END_PORT=13131 VECTOR_DB_PROVIDER=CHROMA SHARED_DIR=<your-home-directory>/ragit-data RAG_COLLECTION=<collection-name>In the above content replace
<valid-api-key>with a valid API key and the<collection-name>with a valid collection name (following the above example the collection name would be stories). -
Customize Variables:
- Replace
valid-api-keywith your actual OpenAI API key. - Substitute
<your-home-directory>with the full path to your home directory. - Set
collection-nameto your specific RAG collection name (e.g.,stories).
- Replace
Under the HOME directory create a ragit-data directory where the data for
all the collections will exist.
The structure should be as follows:
<HOME-DIR>
└── ragit-data
└── <your-collection-name>
└── documents
- Note: Replace
your-collection-namewith your actual RAG collection name.
The directory name documents must always exist under the collection and this
is where you are placing all the documents that will consist the RAG
Collection. Documents can be nested and the directory structure of the
documents directory is completely up to the user of RAGit to decide (again
the only restriction is to be under the documents directory as seen above.
Navigate to your deployment directory (where docker-compose.yaml is located) and execute the following:
```bash
docker-compose up -d db_host
```
```bash
docker-compose run backend
```
-
Navigate to your deployment directory (where
docker-compose.yamlis located) and execute the following command to launch your Dockerized front end:docker-compose up -d frontend
Your RAGIT front end should now be operational and accessible locally through the specified external port as follows:
localhost:13133
or remotely
<ip-address>:13133
If you need to start fresh with the Docker installation, you can run the following commands:
docker stop $(docker ps -aq); docker rm $(docker ps -aq); docker image rm -f $(docker images -q)
docker compose down -v