Dockerfile can’t copy & Docker-compose volume does not sync with container

I am using Docker windows desktop client and trying to build a Flask python container. The dockerfile copies requirements.txt and files into python container and sets it up.

|-root directory (this is where the powershell commands are run from)
|  └── Dockerfile
|  ├──
|  ├── requirements.txt


version: '3'

    build: ./src
      - ./src:/usr/src/app
      - 8080:80


FROM python:3

COPY . /usr/src/app

RUN pip install --no-cache-dir -r requirements.txt

CMD [ "python", "./" ]

Running docker-compose up gives the following error:

ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'

BUT If I change the dockerfile to:

FROM python:3

WORKDIR /usr/src/app

COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

CMD [ "python", "./" ]

It does work, however after the docker-compose up the volume specified in docker-compose does not sync with the container. If I make any changes to the file they are not seen by the container.

What am I doing wrong?

Source: StackOverflow