title: Data of MySql Docker Container doesn't persist after docker-compose up
body: <p>I am running two docker container:</p>
  <ul>
  <li>docker-mysql-activity</li>
  <li>activity-service</li>
  </ul>
  <p>and I make sure of the persistence of the data thanks to the volumes.</p>
  <p>That's my docker-compose.yml</p>
  <pre><code>version: '3'
  services:
  
    docker-mysql-activity:
      image: mysql:latest
      container_name: docker-mysql-activity
      volumes:
      - mysql_activity:/var/lib/mysql
      ports:
        - 33061:3306
      environment:
          - MYSQL_ROOT_PASSWORD=admin123
          - MYSQL_DATABASE=SCactivity
          - MYSQL_USER=testuser
          - MYSQL_PASSWORD=testuser@123
  
    activity-service:
      image: activity-service:latest
      container_name: activity-service
      environment:
        - SPRING_APPLICATION_NAME=activity-service
      hostname: activity-service
      build:
        context: ./activity-service
        dockerfile: Dockerfile
      ports:
        - 9001:9001
      depends_on:
        - service-registry
        - docker-mysql-activity
  
  volumes:
    mysql_activity:
  </code></pre>
  <p>When I execute <strong>docke-compose up</strong> everything goes smoothly and volumes are created, I have verified that looking in the volumes folder of Docker and It saves data correctly (all verified with postman - GET and POST data works correctly).</p>
  <p>The problem occurs when I try <strong>docker-compose down</strong> or <strong>docker-compose stop</strong> and then <strong>docker-compose up</strong> again, data no longer persist.</p>
  <p>I am sure that the issue is not related to <strong>docker-compose down</strong> because the volume persists, instead it is the data inside volume which are reset when I execute the command <strong>docker-compose up</strong>.</p>