CC licenses have been vetted by content publishing lawyers in many countries. CC-BY 4.0 enables commercial re-use.
The Apache license was designed to manage software specific risks.
For the book, you can have a few chapters which are proprietary, clearly marked as such in the book, with the CC chapters explicitly identified. That allows anyone to republish/derive the CC chapters, but not the proprietary chapters. There might be a natural separation between community-authored content and your analysis/perspective chapters.
CC-BY 4.0 also allows derivatives of the community content to be proprietary, so the entire book can remain commercial. There are other CC licenses (share-alike) which have GPL-like qualities. It depends on which outcomes you want to incentivize, and how much effort you want to put into management of content origin, derivatives and/or issuing DMCA takedown notices to Amazon.
For revenue models, look at softcover.io, which provides free-to-read content with upsells to paid ebook and video. It has generated several hundred $K for the Ruby on Rails tutorial. The author has previously posted about this on HN.