title: How to safely stop/start my postgres server when using docker-compose
body: <p>I sometimes stop/start docker very often when I am release new features in my application.</p>
  
  <pre><code>docker-compose up -d
  docker-compose stop
  </code></pre>
  
  <p>I am using pretty much the bare bones postgres docker setup (see below).
  I am mapping the /data folder to my host.</p>
  
  <p>Is there anything I should be worried about if I stop/start docker many times in a day in terms of data getting corrupted?</p>
  
  <p>Is calling <code>docker-compose stop</code> the best way to be stopping my postgres instance?</p>
  
  <p>My postgres service in my docker-compose looks like this:</p>
  
  <pre><code>  db:
      image: postgres:9.4
      volumes:
        - "/home/deploy/data/pgdata:/var/lib/postgresql/data"
      restart: always
  </code></pre>
  
  <p>This setup currently is running smoothly in development, but once it goes to production I want to make sure I am following best practices etc.</p>