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 put the directory name in our .gitignore file, but it still overwrites the SOLR directory.
How do we prevent overwriting certain files that are only on the EC2 server (in the var/app/current directory)?
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.