Fix Interactive Route Map: Create MapRoute records from GPX files

- Create MapRoute database records for all GPX files for map visualization
- Populate route statistics (distance, elevation, coordinates) from GPX parsing
- Update GPX file statistics to mirror MapRoute data for post detail pages
- Enable /community/api/routes endpoint to return proper route data for map iframe
- Fix post detail page GPX statistics display

This resolves the issue where the community map showed '2 routes discovered'
but routes weren't actually rendering on the Leaflet.js map visualization.

Changes:
- Dockerfile: Updated init script paths and added migrate-db call
- app/__init__.py: Added admin user auto-creation with error handling
- app/routes/community.py: Added debug logging and API route for map data
- docker-compose.yml: Simplified to use .env for environment variables
- run.py: Added comprehensive database schema migration command
This commit is contained in:
2025-12-31 18:46:21 +02:00
parent 16cc3fb0ba
commit f8508a436a
5 changed files with 142 additions and 90 deletions

View File

@@ -5,13 +5,10 @@ services:
dockerfile: Dockerfile
ports:
- "8100:5000"
environment:
- FLASK_CONFIG=production
- DATABASE_URL=sqlite:////data/moto_adventure.db
- SECRET_KEY=ana_are_mere_si-si-pere_cat-cuprinde_in_cos
working_dir: /opt/moto_site
volumes:
- ./data:/data # Database persistence
- ./data:/opt/moto_site/data # Database persistence
- ./uploads:/opt/moto_site/uploads # File uploads persistence
- ./app/static/media:/opt/moto_site/app/static/media # Media files persistence
- ./.env:/opt/moto_site/.env # Load .env file
restart: unless-stopped