added some dotenv stuff

This commit is contained in:
root
2024-06-28 20:10:47 -05:00
parent 50dd0df84f
commit 2ed9f3345d
4 changed files with 13 additions and 2 deletions

View File

@@ -12,4 +12,4 @@ authors = [
license = { file = "LICENSE" }
requires-python = ">=3.10"
dependencies = ["rich", "requests", "click", "docker"]
dependencies = ["rich", "requests", "click", "docker", "python-dotenv"]

View File

@@ -3,4 +3,5 @@ ruff
rich
requests
click
docker
docker
python-dotenv

View File

@@ -81,6 +81,7 @@ def main(
logging.getLogger('urllib3.connectionpool').setLevel('WARNING')
if project is not None and services is not None:
logger.debug(f'Using project {project} and stopping services: {services}')
decorator = manage_containers(project=project, services=services.split(','))
func = decorator(run)
else:
@@ -96,4 +97,10 @@ def main(
if __name__ == '__main__':
from dotenv import load_dotenv
from pathlib import Path
dotenv_file = Path.cwd() / '.env'
print(dotenv_file)
load_dotenv(dotenv_path=dotenv_file)
main()

View File

@@ -35,4 +35,7 @@ def main(loki_url: str = None):
if __name__ == '__main__':
from dotenv import load_dotenv
load_dotenv()
main()