Catch SIGTERM and exit gracefully
Catch SIGTERM and exit gracefully

"docker-compose stop" sends SIGTERM.
This PR catches and handles the SIGTERM signal.

Adapted from...

https://gist.github.com/wonderbeyond/d38cd85243befe863cdde54b84505784

Per docker documentation https://docs.docker.com/engine/reference/run/

Note: A process running as PID 1 inside a container is treated specially
by Linux: it ignores any signal with the default action. So, the process
will not terminate on SIGINT or SIGTERM unless it is coded to do so.

CenterForOpenScience/waterbutler,RCOSDP/waterbutler,rdhyee/waterbutler,felliott/waterbutler,TomBaxter/waterbutler