title: Passing files as an argument in docker-compose.yml
body: <p>I am running a <code>docker</code> container with below command</p>
  <pre><code>    docker run -d -v /root/myapp/solution/dataFile:/myapp/data -p 1080:1081 8cb989ef80b5
  </code></pre>
  <p>The dataFile contains some data which is needed for the successful run of container. Next I am trying to put use docker-compose to lauch the container with below docker-compose.yaml file</p>
  <pre><code>   version: &quot;3.7&quot;
     services:
     myapp:
         image: myserver/myapp:latest
     ports:
       - &quot;1080:1081&quot;
    volumes:
       - /root/myapp/solution/dataFile:/myapp/data
  </code></pre>
  <p>But when I ran the <code>docker-compose</code> command it is failing with below error</p>
  <pre><code> myapp_1  | 2021/12/07 11:58:37 error while reading the file &quot;/myapp/data&quot;: read /myapp/data: is a directory
   $ ls -l
   total 0
   drwxr-xr-x    3 root     root            15 Dec  7 11:49 dataFile
   [node1] (local) root@192.168.0.18 ~/myapp/solution
   $ pwd
   /root/myapp/solution
   
  </code></pre>
  <p>On inspecting the contents, I can see <code>dataFile</code> is created at a directory because of which the script is failing . How to pass the arguments as a file so that the <code>docker-compose</code> succeeds.</p>