title: Docker Compose "ERROR: file not found", but ubuntu shell can find the file
body: <p>I'm trying to get a Docker Compose script to test a python program. The following is the .sh to run the docker-compose command. </p>
  
  <pre><code>#!/usr/bin/env bash
  
  script_path=$( cd "$( dirname "${BASH_SOURCE[0]}" )" &amp;&amp; pwd )
  base_path=${script_path}/src
  
  container_path=${base_path}/deploy/
  docker_compose_path=${container_path}docker-compose.yml
  
  sudo nano ${base_path}/tests/scrap/test_r.py
  
  docker-compose -f "${docker_compose_path}" run service_name pytest -x ${base_path}/tests/scrap/test_r.py
  docker-compose -f "${docker_compose_path}" down
  </code></pre>
  
  <p>The problem when running it is that an error shows up with the following message:</p>
  
  <pre><code>ERROR: file not found: /correct/path/to/test_r.py
  </code></pre>
  
  <p>NOTE: I have checked many times and the path (absolute) is correct.</p>
  
  <p>The odd thing about the error is that the shell can find it with no problem. The nano command that is right on top of the docker-compose one works perfectly, loading the file with the correct content. Still, with the same exact path, docker-compose seems to not be able to find it and execute it (already tried chmod +x test_r.py but it did not work. Docker Compose simply doesn't find it).</p>
  
  <p>Whatever extra info that you need, you can ask. Thanks :P</p>
  
  <p>NOTE: I'm not considering as a source of the problem the fact that the project worked perfectly on another computer that was running MacOS. My pc is trying to execute the scripts in an Ubuntu environment. If taking that into account is a step in the right direction, I don't know how to move toward solving the issue.</p>
  
  <p>Edit: adding info of the file docker-compose.yml:</p>
  
  <pre><code>version: '3.5'
  
  services:
    service_name:
      image: image_name
      build:
        context: ../
        dockerfile: Dockerfile
      tty: true
      volumes:
        - ../../../workers:/opt/workers/
      working_dir: /opt/workers/src
      env_file:
        - ../local/worker.env
  </code></pre>