I have a docker-compose.yml configuration. In one of the containers there is a Tomcat server and it has some default .war file deployed in we
Let's say that the .war filename is "app.war"... you could overwrite it using a env variable like this:
volumes:
- ./application/webapps/${APPLICATION_ENV}.war:/usr/local/tomcat/webapps/app.war
Then when you need to run a different war file just change the APPPLICATION_ENV value to the one you need to run and restart the container.
I don't think docker-compose does have "conditional volumes", but that way you could change the app.war according with your environment.
Other way would be running a script after the docker-compose up/start to overwrite it, and do it only when needed, like:
docker-compose exec your-container-name cp /a/volume/path/app.war /usr/local/tomcat/webapps/app.war