Check out internet in a box. The Wikipedia foundation supports it. IMO that is also over engineered for my needs, so built a lighter weight variant.
That's how they get wikipedia on this btw.
In my variant I have the complete English Wikipedia, a ton of official documentation on programming languages I use or might need to use, as well as calibre for eBook and pdf housing.
All running in docker containers, behind an nginx reverse proxy landing page.