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