We have SOLR in our app directory on EC2 server and not on our local git repository. When we are pushing our local repository to EC2, it is erasing the Solr directory. We have
AWS Elastic Beanstalk instances do not have persistent storage. EC2 instance is restored with default filesystem on each git push.
You can persist SOLR files in S3 and automatically retrieve them on container startup with container commands.
Other options are mentioned in "Persistent Storage" section in AWS Elastic Beanstalk Design Considerations.