title: How to delete postgres database within docker container
body: <p>I am trying to figure out how to completely remove a docker container with a postgres database and rebuild using docker-compose?</p>
  
  <p>I created a server and database container using docker-compose. The database did not get set up how I wanted, so I would like to remove the database and rebuild. I assumed the easiest solution, given it is brand new would be to stop the container from running, remove the container and then run docker-compose again. </p>
  
  <p>I have followed those steps, do not see any of the containers. I do not see any volumes associated with the containers. However, when I run docker-compose it appears to be using the postgres database that was previously created?</p>
  
  <p>Here is what my docker-compose files consists of with user/password/db name extracted.</p>
  
  <pre><code>services:
    server:
      image: "node:10"
      user: "node"
      working_dir: /home/node/app
      volumes:
        - ./:/home/node/app
      ports:
        - 3030:3030
      command: "npm start"
      depends_on:
        - db
    db:
      image: postgres:latest
      restart: always
      environment:
        POSTGRES_USER: [user] 
        POSTGRES_PASSWORD: [password]
        POSTGRES_DB: [db_name]
      volumes:
        - ./data/postgres:/var/lib/postgresql/data
  </code></pre>
  
  <p>I expected that by using: </p>
  
  <p><code>docker stop [container]</code> to stop the container, then
  <code>docker rm [container]</code> to remove the container</p>
  
  <p>I could rebuild fresh with <code>docker-compose up</code></p>