Enhance Docker support and configuration

- Updated .env.example to recommend using docker.env and secrets for sensitive data.
- Modified .gitignore to include docker.env and secrets directory.
- Adjusted docker-compose.yml to utilize environment files and updated port mappings.
- Implemented read_env_or_file utility for better environment variable management.
- Refactored portfolio and trades routers to use the new utility for fetching environment variables.
- Added integration and phase 2 test updates for new environment variable handling.
- Created new documentation for Docker operations and secret management.
- Added placeholder files for Docker secrets and configuration.
This commit is contained in:
coddard
2026-05-19 01:49:11 +03:00
parent 0096c8819b
commit eabc96371b
17 changed files with 404 additions and 44 deletions
+2 -1
View File
@@ -2,6 +2,7 @@
Phase 2 test suite — uses TestClient with mocked IB and DB dependencies.
Run: pytest tests/test_phase2.py -v
"""
import os
import sqlite3
import sys
import threading
@@ -88,7 +89,7 @@ _app.include_router(portfolio.router)
client = TestClient(_app, raise_server_exceptions=False)
WRONG_SECRET = "wrong_secret"
RIGHT_SECRET = "your_super_secret_string_123"
RIGHT_SECRET = os.getenv("WEBHOOK_SECRET", "your_super_secret_string_123")
# ── Tests ─────────────────────────────────────────────────────────────────────