Added Docker and Removed Socket Integration

This commit is contained in:
Azeez Muibi
2025-03-21 08:41:00 +01:00
parent af9a6148a1
commit 167381c62d
9 changed files with 439 additions and 55 deletions
+1 -18
View File
@@ -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)