diff --git a/CHANGELOG.md b/CHANGELOG.md index 29e4d1a..a81e2a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed +- **Dev Mode Warning in Docker** - DEV mode startup warning now displays correctly in Docker logs + - Added FastAPI `@app.on_event("startup")` handler to trigger warning on API server startup + - Previously only appeared when running `python api/main.py` directly (not via uvicorn) + - Docker compose now includes `DEPLOYMENT_MODE` and `PRESERVE_DEV_DATA` environment variables + ## [0.3.0] - 2025-10-31 ### Added - Price Data Management & On-Demand Downloads diff --git a/api/main.py b/api/main.py index 5c466cf..af34dbb 100644 --- a/api/main.py +++ b/api/main.py @@ -136,6 +136,11 @@ def create_app( app.state.db_path = db_path app.state.config_path = config_path + @app.on_event("startup") + async def startup_event(): + """Display DEV mode warning on startup if applicable""" + log_dev_mode_startup_warning() + @app.post("/simulate/trigger", response_model=SimulateTriggerResponse, status_code=200) async def trigger_simulation(request: SimulateTriggerRequest): """ diff --git a/docker-compose.yml b/docker-compose.yml index 761d341..f6499ef 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,6 +10,10 @@ services: - ${VOLUME_PATH:-.}/logs:/app/logs - ${VOLUME_PATH:-.}/configs:/app/configs environment: + # Deployment Configuration + - DEPLOYMENT_MODE=${DEPLOYMENT_MODE:-PROD} + - PRESERVE_DEV_DATA=${PRESERVE_DEV_DATA:-false} + # AI Model API Configuration - OPENAI_API_BASE=${OPENAI_API_BASE} - OPENAI_API_KEY=${OPENAI_API_KEY}