Docker-compose says can’t open file – no file on directory but the file exist

So this problem occurs when I have created a copy of a file and tried to run it. Say, I had a file name prod_run.py and I tried to make a copy and run it in dev_run.py. I made the necessary changes on docker-compose file for the dev server but when I try to run it, it says, can’t open file, no such file or directory! So, I tried docker exec command to run the file from within the container to see whats wrong, but the problem still persist!

Expected behavior

The smooth building of docker container

Actual behavior

/usr/local/bin/python: can’t open file ‘dev_run.py’: [Errno 2] No such file or directory

Additional Information

snippet of docker-compose-dev file

version: "3"
services:
  middleware:
    build:
      context: project_one/
    depends_on:
      - "redis_cache"
    environment:
      - REDIS_HOST=redis_cache
      - REDIS_PORT=5789
    volumes:
      - /home/$USER/.raster/:/app/_images/
    ports:
      - "8000"
    networks:
      - middleware
    restart: always
    command: ["python", "dev_run.py"]

Command to run:

sudo docker-compose -f "docker-compose-dev.yml" up --build --remove-orphans

Build information:

cache_manager_1          | [2020-04-07 07:40:25 +0000] [9] [INFO] Starting worker [9]
ban_manager_1            | [2020-04-07 07:40:25 +0000] [9] [INFO] Starting worker [9]
middleware_1  | [2020-04-07 07:40:25 +0000] [1] [INFO] Goin' Fast @ http://0.0.0.0:8000
middleware_1  | /usr/local/bin/python: can't open file 'dev_run_map.py': [Errno 2] No such file or directory

Help is much needed 🙁

Source: StackOverflow