fix: read version from env var so it works inside Docker
All checks were successful
Release / build-and-push (push) Successful in 28s
CI / lint-and-test (push) Successful in 21s

This commit is contained in:
2026-04-20 17:15:55 +02:00
parent 5e02f5a402
commit 6a80bf4eb9
3 changed files with 5 additions and 2 deletions

View File

@@ -136,8 +136,9 @@ async def metrics():
@app.get("/api/version")
async def version():
version_file = Path(__file__).parent.parent / "VERSION"
return {"version": version_file.read_text().strip() if version_file.exists() else "unknown"}
import os
return {"version": os.environ.get("VERSION", "unknown")}
frontend_dir = Path(__file__).parent / "frontend"

View File

@@ -26,6 +26,7 @@ services:
env_file:
- .env
environment:
VERSION: ${AOC_VERSION:-latest}
MONGO_URI: mongodb://${MONGO_ROOT_USERNAME}:${MONGO_ROOT_PASSWORD}@mongo:27017/
depends_on:
mongo:

View File

@@ -20,6 +20,7 @@ services:
env_file:
- .env
environment:
VERSION: ${AOC_VERSION:-dev}
MONGO_URI: mongodb://${MONGO_ROOT_USERNAME}:${MONGO_ROOT_PASSWORD}@mongo:${MONGO_PORT}/
depends_on:
- mongo