When we stayed in Cocoa Beach before our cruises, we typically were there for 2-3 nights. We really enjoyed staying at the Cocoa Beach Hampton Inn.
https://www.hilton.com/en/hotels/coibhhx-hampton-cocoa-beach-cape-canaveral/
The beach is very close by - just a short walk down a pathway through the dunes. We were lucky and got to watch a rocket launch from the beach during one of our stays They have a nice sized pool and a free breakfast buffet. Ron Jon’s is a short walk from the hotel, as are many food and shopping places. On the morning of the cruise, we took a shuttle (which we booked and paid for at the front desk) from the hotel to the port.