Unifi makes a doorbell and consumer (and commerical) security cameras which run and store data on a local device, but still reachable online with their app connecting directly to your device. I used their dream machine pro with a big HDD, but they're released a few other devices in the last few years which might be cheaper and use SSDs. And I think you could run the stack in docker. But if you want to hack it yourself, there's probably easier projects. If you want to spend a bit more but have everything more or less just work with nice hardware and apps, Ubiquity's Unifi system is really great for home security. Not to mention the wifi and other networking solutions they have.