The easiest way is to use GitHub Enterprise.
If thats too expensive, use GitHub CE.
Both can be run in AWS cheaply and securely especially if you require VPN access to your VPC.
Sorry if my response my sound naive, but can't anyone just clone/copy the code in GitHub Enterprise and compress and release anywhere if one wanted to?