echo-agent / app.py
Kuk1's picture
Switch to Docker SDK for build stability
2bb2438
raw
history blame contribute delete
693 Bytes
import sys
import os
from dotenv import load_dotenv
# Load environment variables from .env file if present
load_dotenv()
# Ensure 'src' is in the Python path so we can import our modules
sys.path.append(os.path.join(os.path.dirname(__file__), "src"))
from ui.layout import create_ui
if __name__ == "__main__":
# Launch the application
ui = create_ui()
# Use environment variables for configuration, with safe defaults
# 0.0.0.0 is required for Docker/Hugging Face Spaces
server_name = os.getenv("GRADIO_SERVER_NAME", "0.0.0.0")
server_port = int(os.getenv("GRADIO_SERVER_PORT", "7860"))
ui.launch(server_name=server_name, server_port=server_port)