service-preprocessing/app.py
2025-10-15 11:24:56 +02:00

23 lines
647 B
Python

#!/usr/bin/env python3
"""
Azure entry point for PowerOn Preprocessing App.
This file redirects to the actual application in the src directory.
"""
import os
import sys
# Add current directory to Python path
sys.path.insert(0, os.path.dirname(__file__))
# Ensure DATA_DIR exists (Azure persistent storage at /home/data)
data_dir = os.environ.get("DATA_DIR", "/home/data")
os.makedirs(data_dir, exist_ok=True)
print(f"Data directory ready: {data_dir}")
# Import the actual application
from src.main import app
# For Azure App Service with uvicorn, expose the app at module level
# This allows uvicorn to find it as 'app:app'
application = app