I use a small, quiet Honda generator to charge 2 bike batteries on extended camping road trips. You won't get much charge out of most 12V deep cycle batter charging a 36V or 48V battery with an inverter. It would also take a pretty big solar panel and inverter to get a charge in a decent time.
Most bikes have cage bosses that bottle cages can bolt on to on the down tube and or seat tube, but a lot of ebikes, especially step through or folders don't. You can find strap adapters like the Topeak Versa Mount or SKS Anywhere Adapter if you don't have braze on cage bosses. Alternately, these work as great handle bar water bottle, snack, and bear spray holders:
Amazon.com : Bushwhacker Shasta Black - Insulated Bike Water Bottle Holder w/ 20 oz. Bottle - Two Point Bike Frame & Handlebar Attachment w/Belt Loop No Screws Hardware Required : Bicycle Water Bottle Holder With Bottle : Sports & Outdoors
www.amazon.com