diff --git a/.env b/.env index b15941c..7e803d0 100644 --- a/.env +++ b/.env @@ -1,4 +1,5 @@ # WOL Manager Environment Configuration WOL_NETWORK_MODE=bridge WOL_EXTERNAL_PORT=5000 +FLASK_PORT=5000 FLASK_DEBUG=true \ No newline at end of file diff --git a/.env.example b/.env.example index 1f4b346..f0c3727 100644 --- a/.env.example +++ b/.env.example @@ -10,6 +10,9 @@ WOL_NETWORK_MODE=bridge # For Linux with host mode: this setting is ignored WOL_EXTERNAL_PORT=5000 +# Flask internal port (port on which Flask app runs inside container) +FLASK_PORT=5000 + # Examples: # Windows Docker Desktop: # WOL_NETWORK_MODE=bridge diff --git a/app/app.py b/app/app.py index dbad33b..5f0e4a1 100644 --- a/app/app.py +++ b/app/app.py @@ -485,5 +485,7 @@ def trigger_windows_scan(): }) if __name__ == '__main__': + # Get port from environment variable or default to 5000 + port = int(os.environ.get('FLASK_PORT', 5000)) # Enable debug mode for development with hot reload - app.run(host='0.0.0.0', port=5000, debug=True, use_reloader=True) \ No newline at end of file + app.run(host='0.0.0.0', port=port, debug=True, use_reloader=True) \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 27a7b9f..a2c68d4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,6 +15,7 @@ services: - PYTHONUNBUFFERED=1 - WSL_INTEROP=${WSL_INTEROP} - FLASK_DEBUG=${FLASK_DEBUG:-false} + - FLASK_PORT=${FLASK_PORT:-5000} network_mode: "${WOL_NETWORK_MODE:-bridge}" privileged: true cap_add: