Prioritize OS environment variables over .env file to improve Docker compatibility for the server
This commit is contained in:
@@ -3,7 +3,9 @@ from datetime import datetime, timedelta
|
|||||||
import jwt
|
import jwt
|
||||||
from fastapi import HTTPException, status
|
from fastapi import HTTPException, status
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
|
from dotenv import load_dotenv
|
||||||
|
|
||||||
|
load_dotenv()
|
||||||
|
|
||||||
class TokenPayload(BaseModel):
|
class TokenPayload(BaseModel):
|
||||||
sub: str # Username
|
sub: str # Username
|
||||||
|
@@ -49,7 +49,7 @@ from .auth import auth_handler
|
|||||||
# Load environment variables
|
# Load environment variables
|
||||||
# Updated to use the .env that is inside the current folder
|
# Updated to use the .env that is inside the current folder
|
||||||
# This update allows the user to put a different.env file for each lightrag folder
|
# This update allows the user to put a different.env file for each lightrag folder
|
||||||
load_dotenv(".env", override=True)
|
load_dotenv()
|
||||||
|
|
||||||
# Initialize config parser
|
# Initialize config parser
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
|
@@ -13,7 +13,7 @@ from dotenv import load_dotenv
|
|||||||
|
|
||||||
# Updated to use the .env that is inside the current folder
|
# Updated to use the .env that is inside the current folder
|
||||||
# This update allows the user to put a different.env file for each lightrag folder
|
# This update allows the user to put a different.env file for each lightrag folder
|
||||||
load_dotenv(".env")
|
load_dotenv()
|
||||||
|
|
||||||
|
|
||||||
def check_and_install_dependencies():
|
def check_and_install_dependencies():
|
||||||
|
@@ -16,7 +16,7 @@ from starlette.status import HTTP_403_FORBIDDEN
|
|||||||
from .auth import auth_handler
|
from .auth import auth_handler
|
||||||
|
|
||||||
# Load environment variables
|
# Load environment variables
|
||||||
load_dotenv(override=True)
|
load_dotenv()
|
||||||
|
|
||||||
global_args = {"main_args": None}
|
global_args = {"main_args": None}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user