Spaces:
Sleeping
Sleeping
Upload main.py
Browse files
main.py
CHANGED
|
@@ -118,22 +118,16 @@ with gr.Blocks(title="Task Maistro Assistant", theme=gr.themes.Soft()) as app:
|
|
| 118 |
|
| 119 |
if __name__ == "__main__":
|
| 120 |
# Get port from environment variable (Railway sets this)
|
| 121 |
-
port = int(os.getenv("PORT",
|
| 122 |
-
|
| 123 |
-
# Determine if we're in production (Railway) or development
|
| 124 |
-
is_production = os.getenv("RAILWAY_ENVIRONMENT") is not None
|
| 125 |
-
server_name = "0.0.0.0" if is_production else "127.0.0.1"
|
| 126 |
|
| 127 |
# Launch the app
|
| 128 |
print(f"Starting application on port {port}")
|
| 129 |
-
print(f"Environment: {'Production (Railway)' if is_production else 'Development (Local)'}")
|
| 130 |
-
print(f"🌐 Access the app at: http://{'0.0.0.0' if is_production else 'localhost'}:{port}")
|
| 131 |
|
| 132 |
app.launch(
|
| 133 |
-
server_name=
|
| 134 |
-
server_port=
|
| 135 |
share=False,
|
| 136 |
show_error=True,
|
| 137 |
-
inbrowser=
|
| 138 |
-
quiet=is_production # Reduce logging in production
|
| 139 |
)
|
|
|
|
| 118 |
|
| 119 |
if __name__ == "__main__":
|
| 120 |
# Get port from environment variable (Railway sets this)
|
| 121 |
+
port = int(os.getenv("PORT", 7860)) # Changed default to match Dockerfile
|
| 122 |
+
|
|
|
|
|
|
|
|
|
|
| 123 |
|
| 124 |
# Launch the app
|
| 125 |
print(f"Starting application on port {port}")
|
|
|
|
|
|
|
| 126 |
|
| 127 |
app.launch(
|
| 128 |
+
server_name="0.0.0.0",
|
| 129 |
+
server_port=7860,
|
| 130 |
share=False,
|
| 131 |
show_error=True,
|
| 132 |
+
inbrowser=True
|
|
|
|
| 133 |
)
|