refactor(config): Switch to environment variables for API keys

- Modifies docker-compose.yml to use  for injecting the Gemini API key, which is more robust than volume mounting.
- Updates helpers.py to prioritize reading the API key from the  environment variable.
- Removes the now-redundant file-based key loading logic from config.py and the Dockerfile.
- This change completely bypasses the problematic file system interactions within the container, providing a definitive fix for the 'API Key missing' error.
This commit is contained in:
2026-01-03 09:30:34 +00:00
parent 62d03e24a4
commit b35a53b755
4 changed files with 29 additions and 45 deletions

View File

@@ -101,10 +101,8 @@ services:
- ./gtm_db_manager.py:/app/gtm_db_manager.py
- ./gtm_projects.db:/app/gtm_projects.db
- ./Log_from_docker:/app/Log_from_docker
# Mount API keys
- ./gemini_api_key.txt:/app/gemini_api_key.txt
- ./gemini_api_key.txt:/app/api_key.txt
- ./serpapikey.txt:/app/serpapikey.txt
environment:
environment:
- PYTHONUNBUFFERED=1
- DB_PATH=/app/gtm_projects.db
- DB_PATH=/app/gtm_projects.db
env_file:
- ./gemini_api_key.txt