title: docker-compose - ADD failed: Forbidden path outside the build context
body: <p>I have such folder structure</p>
  
  <pre><code>project
      - config
          -docker
             Dockerfile
             docker-compose.yml
      - src
         here_is_code
      requirements.txt
  </code></pre>
  
  <p>Dockerfile</p>
  
  <pre><code>FROM python:3
  ENV PYTHONUNBUFFERED 1
  RUN mkdir /code
  WORKDIR /code
  ADD ../../requirements.txt /code/
  RUN pip install -r requirements.txt
  ADD src /code/
  </code></pre>
  
  <p>docker-compose.yml</p>
  
  <pre><code>version: '3'
  
  services:
    web:
      build:
        context: ../../
        dockerfile: config/docker/Dockerfile
      command:
          bash -c "ls"
      volumes:
        - .:/code
      expose:
        - "8000"
    nginx:
      image: nginx
      ports:
      - "8000:8000"
      volumes:
        - .:/code
        - ./config/nginx:/etc/nginx/conf.d
      depends_on:
      - web
  </code></pre>
  
  <p>When I run <code>docker-compose build</code> I get following error:</p>
  
  <blockquote>
    <p>Service 'web' failed to build: ADD failed: Forbidden path outside the build context: ../../requirements.txt ()</p>
  </blockquote>
  
  <p>Is it possible to add requirements.txt or I'll have to copy this file into docker directory? Or maybe I need to use any entrypoint (entrypoint.sh)?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>After <code>docker build -f config/docker/Dockerfile .</code> and <code>docker-compose up</code> I can't see my code there. Here is the output of <code>ls -R /code</code></p>
  
  <pre><code>web_1    | /code:
  web_1    | Dockerfile
  web_1    | config
  web_1    | docker-compose.yml
  web_1    | src
  web_1    | static
  web_1    | 
  web_1    | /code/config:
  web_1    | nginx
  web_1    | 
  web_1    | /code/config/nginx:
  web_1    | 
  web_1    | /code/src:
  web_1    | static
  web_1    | 
  web_1    | /code/src/static:
  web_1    | 
  web_1    | /code/static:
  </code></pre>