title: How to separate docker and docker-compose from Django source folder
body: <p>I am trying to achieve this project layout structure:</p>
  
  <pre><code>project root:
      - docker:
          - docker-compose.yml
          - Dockerfile-app
          - Dockerfile-mysql
      - src:
          - djangoproj
              - core
              - requirements.txt
  </code></pre>
  
  <p>docker-compose.yml</p>
  
  <pre><code>version: '3'
  
  services:
    app:
      build:
        context: .
        dockerfile: Dockerfile-app
      command: /bin/bash -c "cd /var/www/app/src/djangoprj &amp;&amp; pip install -r requirements-develop.tx  &amp;&amp; python manage.py runserver 0.0.0.0:8000 || sleep 100000"
      container_name: website_app
      depends_on:
        - mysql
      links:
        - mysql
      ports:
        - '8000:8000'
      volumes:
        - ../:/var/www/app
      working_dir: /var/www/app/src/djangoproj
  
    mysql:
      build:
        context: .
        dockerfile: Dockerfile-mysql
      container_name: website_mysql
      environment:
        MYSQL_ROOT_PASSWORD: password
        MYSQL_DATABASE: local
        MYSQL_USER: yoo
        MYSQL_PASSWORD: password
      ports:
        - '3306:3306'
  </code></pre>
  
  <p>This basically works, the only issue I have, it is that the requirements are built every single time.</p>
  
  <p>What I would like is that in the Dockerfile-app to copy the requirements.txt file and then run the pip install which I expect to run only when the requirements.txt was changed.</p>
  
  <p>Inside Dockerfile-app:</p>
  
  <pre><code>ADD src/djangoproj/requirements.txt /
  RUN pip install -r requirements.txt
  </code></pre>
  
  <p>From what I know in docker I can't access the parent folder.
  I was also trying to do</p>
  
  <pre><code>app:
    build:
      context: ..
  </code></pre>
  
  <p>But doesn't output anything... so I don't know what it is going on...</p>
  
  <p>When is the volume added to the docker container?</p>
  
  <p>Any help will be so much appreciated</p>