title: What is the impact on not using volumes in my docker-compose?
body: <p>I am new to docker, what a wonderful tool!. Following the Django tutorial, their docs provide a basic <code>docker-compose.yml</code>, that looks similar to the following one that I've created.</p>
  
  <pre><code>version: '3'
  
  services:
    web:
      build: .
      container_name: web
      command: python manage.py migrate
      command: python manage.py runserver 0.0.0.0:8000
      volumes:
        - ./src:/src
      ports:
        - "8000:8000"
      depends_on:
        - postgres
    postgres:
      image: postgres:latest
      container_name: postgres
      environment:
        POSTGRES_USER: my_user
        POSTGRES_PASSWORD: my_secret_pass!
        POSTGRES_DB: my_db
      ports:
        - "5432:5432"
  </code></pre>
  
  <p>However, in every single docker-compose file that I see around, the following is added:</p>
  
  <pre><code>volumes:
    - ./postgres-data:/var/lib/postgresql/data
  </code></pre>
  
  <p>What are those volumes used for? Does it mean that if I now restart my postgres container all my data is deleted, but if I had the volumes it is not? </p>
  
  <p>Is my <code>docker-compose.yml</code> ready for production?</p>