pducharme / UniFi-Video-Controller

Docker for Unifi-Video Controller (Ubiquiti Networks)
199 stars 105 forks source link

Allow running unifi-video controller as PUID/PGID. #7

Closed fryfrog closed 7 years ago

fryfrog commented 7 years ago

This is my initial attempt at getting unifi-video running as unifi-video inside the container and allowing the uid/gid to be specified.

It needs review, testing and feedback, I'm hoping you can help me out w/ that. Don't merge this as is! :)

fryfrog commented 7 years ago

So this is working for me except that I can't login at http, it just loops to login again. It works fine via https, though of course https has certificate warnings.

The big improvements here are that it actually uses the unifi-video script (which has had the ulimit lines removed) to start. Even better, it now gracefully stops the daemon.

The unifi-video script does some work with tmpfs, thus the use of --privileged. I'll try to eliminate that next, docker has the --tmpfs option that looks like it'd get it setup and I can remove the check from the script itself... maybe.

fryfrog commented 7 years ago

This goes with issue #5, in case it wasn't obvious.

The final form is working for me in both http and https. The graceful shutdown got moved into a function so it was easier to read. The unifi-video turned into a .patch to make maintenance simpler down the road, in case the file changes.

This is ready for a test, I think.