I am trying to create a docker environment for my project. Let me explain.
I have a project called my-project which produces a war my-project.war. I created a Docker image called my-project:latest which contains the my-project.war in the /my-project directory. That was easy.
Now I want to combine the Docker images my-project:latest and tomcat:latest (which is the official Docker image for Tomcat) in docker-compose.yml. I started with this docker-compose.yml:
version: "3"
services:
my-project:
image: my-project:latest
tomcat:
image: tomcat:latest
ports:
- 8080:8080
But how can I now copy the file /my-project/my-project.war from the my-project container to the webapps/ directory in the tomcat container? Is this possible in docker-compose or should I start from a new Dockerfile?
In other words, I am having troubles combining these two containers.