title: How to set the "current" directory of a Dockerfile with Docker Compose?
body: <p>I have the following project structure:</p>
  
  <pre><code>.
  ..
  project/
  docker/cli/Dockerfile
  docker-compose.yml
  </code></pre>
  
  <p>In <code>docker-compose.yml</code> I have the following configuration:</p>
  
  <pre><code>cli:
    build: docker/cli
  </code></pre>
  
  <p>And somewhere in my Dockerfile:</p>
  
  <pre><code>COPY . /app
  </code></pre>
  
  <p>Now the problem is that when I do <code>docker-compose build cli</code> docker copies the contents of <code>docker/cli/</code> in <code>/app</code> in my image. Which makes sense because that is the relative path to my <code>docker/cli/Dockerfile</code>. Is there a way however to tell in my <code>docker-compose.yml</code> config that the path should be different (namely the root dir of my project where the actual project files are)?</p>