title: Flush Flower database occasionally and/or exit gracefully from Docker?
body: <p>I'm running Celery Flower in Docker (see <a href="https://stackoverflow.com/questions/35929442/access-named-volume-from-container-when-not-running-as-root">this question</a> for details). The command ends up being:</p>
  
  <pre><code>celery -A proj flower --persistent=True --db=/flower/flower
  </code></pre>
  
  <p>I've got a persistent volume all set up on <code>/flower</code>. However, it looks like Flower never writes anything to its database file, even after 30 minutes of uptime (during which ~120 tasks were processed):</p>
  
  <pre><code>-rw-r--r--  1 user user    0 Mar 11 00:08 flower.bak
  -rw-r--r--  1 user user    0 Mar 10 23:29 flower.dat
  -rw-r--r--  1 user user    0 Mar 11 00:08 flower.dir
  </code></pre>
  
  <p>Stopping the Docker container gracefully doesn't work, and so Docker forcefully kills it, which means nothing ends up being written to the database and so it's as if nothing was persisted.</p>
  
  <p>Is there a way to get Flower to either flush its database occasionally, or, better yet, to exit gracefully?</p>