Added Docker and Removed Socket Integration
This commit is contained in:
@@ -8,8 +8,6 @@ from config import Config
|
||||
from api.routes import register_blueprints
|
||||
from api.middleware import register_middleware
|
||||
import logging
|
||||
import socket
|
||||
import sys
|
||||
|
||||
def create_app(config_class=Config) -> Flask:
|
||||
"""
|
||||
@@ -57,20 +55,5 @@ def create_app(config_class=Config) -> Flask:
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = create_app()
|
||||
|
||||
# Get port from config or use a default
|
||||
port = app.config.get('PORT', 5000)
|
||||
|
||||
# Try to run the app, with better error handling for socket issues
|
||||
try:
|
||||
app.run(debug=app.config.get('DEBUG', False), host='0.0.0.0', port=port)
|
||||
except socket.error as e:
|
||||
if e.errno == 10013: # Permission denied error on Windows
|
||||
print(f"Error: Permission denied when trying to bind to port {port}.")
|
||||
print("Try one of the following solutions:")
|
||||
print(f"1. Use a different port (above 1024): set PORT=8080 in your environment variables")
|
||||
print("2. Run the application with administrator privileges")
|
||||
print("3. Check if another application is already using this port")
|
||||
else:
|
||||
print(f"Socket error: {e}")
|
||||
sys.exit(1)
|
||||
app.run(debug=app.config.get('DEBUG', False), host='0.0.0.0', port=port)
|
||||
Reference in New Issue
Block a user