Persist aircraft DB under data/adsb/ for Docker volume compatibility

Move aircraft_db.json and aircraft_db_meta.json from the project root
to data/adsb/ so they survive container restarts and rebuilds. Add
matching volume mount to both Docker Compose profiles.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
James Smith
2026-03-21 16:56:34 +00:00
parent 6928b8a622
commit af2ab567ca
2 changed files with 5 additions and 2 deletions

View File

@@ -33,6 +33,7 @@ services:
- ./data/weather_sat:/app/data/weather_sat
- ./data/radiosonde:/app/data/radiosonde
- ./data/subghz:/app/data/subghz
- ./data/adsb:/app/data/adsb
# Optional: mount logs directory
# - ./logs:/app/logs
environment:
@@ -92,6 +93,7 @@ services:
- ./data/weather_sat:/app/data/weather_sat
- ./data/radiosonde:/app/data/radiosonde
- ./data/subghz:/app/data/subghz
- ./data/adsb:/app/data/adsb
environment:
- TZ=${TZ:-UTC}
- INTERCEPT_HOST=0.0.0.0

View File

@@ -14,8 +14,9 @@ from urllib.request import Request, urlopen
logger = logging.getLogger('intercept.aircraft_db')
# Database file location (project root)
DB_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Database file location (persisted under data/adsb/ for Docker volume compatibility)
DB_DIR = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'data', 'adsb')
os.makedirs(DB_DIR, exist_ok=True)
DB_FILE = os.path.join(DB_DIR, 'aircraft_db.json')
DB_META_FILE = os.path.join(DB_DIR, 'aircraft_db_meta.json')