-
Notifications
You must be signed in to change notification settings - Fork 0
The .env file for docker
The .env file is crucial for configuring environment-specific variables for
the RAGIT application when running inside DOCKER.
This file allows you to manage various settings such as
API keys, database credentials, and application ports in a centralized manner.
This guide explains the purpose of each variable in the .env file and how to
set them up correctly.
Below is an example of a .env file:
OPENAI_API_KEY=<valid-openai-key>
POSTGRES_DB=postgres
POSTGRES_USER=postgres
POSTGRES_PASSWORD=mypassword
POSTGRES_PORT=5432
POSTGRES_HOST=db_host
EXTERNAL_FRONT_END_PORT=13133
INTERNAL_FRONT_END_PORT=8789
VECTOR_DB_PROVIDER=<CHROMA or MILVUS>
SHARED_DIR=<path-to-shared-directory>
RAG_COLLECTION=<your-rag-collection-name>The Configuration Parameters are the following:
- Description: The API key for accessing OpenAI's services.
- Format: String
-
Example:
OPENAI_API_KEY=sk-xxxxxx
- Description: The name of the PostgreSQL database.
- Format: String
-
Example:
POSTGRES_DB=postgres
- Description: The username for accessing the PostgreSQL database.
- Format: String
-
Example:
POSTGRES_USER=postgres
- Description: The password for accessing the PostgreSQL database.
- Format: String
-
Example:
POSTGRES_PASSWORD=mypassword
- Description: The port number on which the PostgreSQL database is running.
- Format: Integer
-
Example:
POSTGRES_PORT=5432
- Description: The hostname or IP address where the PostgreSQL database is hosted.
- Format: String
-
Example:
POSTGRES_HOST=db_host
- Description: The external port number for accessing the RAGIT web application.
- Format: Integer
-
Example:
EXTERNAL_FRONT_END_PORT=13133
- Description: The internal port number the frontend service listens on.
- Format: Integer
-
Example:
INTERNAL_FRONT_END_PORT=8789
- Description: Specifies the vector database provider to be used.
-
Options:
CHROMAorMILVUS -
Example:
VECTOR_DB_PROVIDER=CHROMA
- Description: The path to the shared directory that holds the data collection.
- Format: Full path (String)
-
Example:
SHARED_DIR=/home/user/ragit-data - Note: This path should be accessible by both the host and guest machine/containers.
- Description: The name of the RAG collection to be used.
- Format: String
-
Example:
RAG_COLLECTION=stories -
Note: This should correspond to the sub-directory under
SHARED_DIRwhere the collection data is stored.
-
Create the .env File: In the root directory of the RAGIT repository, create a file named
.env.touch .env
-
Add Configuration Parameters: Open the
.envfile in your preferred text editor and add the configuration parameters as shown in the example above. Replace placeholder values (like<valid-openai-key>,<path-to-shared-directory>, and<your-rag-collection-name>) with actual values appropriate for your environment.
Example:
OPENAI_API_KEY=sk-abcdefghijklmnopqrstuvwxy1234567890
POSTGRES_DB=postgres
POSTGRES_USER=postgres
POSTGRES_PASSWORD=secretpassword
POSTGRES_PORT=5432
POSTGRES_HOST=db_host
EXTERNAL_FRONT_END_PORT=13133
INTERNAL_FRONT_END_PORT=8789
VECTOR_DB_PROVIDER=CHROMA
SHARED_DIR=/home/user/ragit-data
RAG_COLLECTION=stories- Save and Close: Save the changes and close the text editor.
The .env file plays a vital role in configuring the RAGIT application by
centralizing critical environment variables. By properly setting up this file,
you ensure that all components of the RAGIT application can easily access the
necessary configuration settings, leading to a smoother and more efficient
deployment process.