Springboot-camunda dockerized database mysql

Hello to all,
i created two camunda instances on docker (cam1 and cam2) and i made both point to a mysql db to make the data persistent. When I start a process from cam1 and then turn off all instances, when the containers are restarted the process remains blocked and not complete. If, on the other hand, I create the cam1 and cam2 instances using springboot + camunda (generating cam1.jar and cam2.jar) and then putting them on docker (with the dockerfile), and I execute the same procedure the process is completed. What is the difference between camunda + springboot and camunda image docker? They both use tomcat as their application server, right? Thanks