title: How do I mount a single file in docker-compose
body: <p>I have a project that need to mount a single directory into the docker container, and I mount it in a similar way</p>
  <pre><code>agent:
      image: agent:latest
      container_name: agent
      volumes:
        - $PWD/status.txt:/status.txt
  </code></pre>
  <p><code>Is A Directory</code> error occurs when I modify status.txt in <code>open</code> mode.</p>
  <pre><code>with open('status.txt','a') as f:
      ...
      ...
  </code></pre>
  <p>docker-compose seems to <strong>recognize files as directories</strong>.</p>
  <p>I would appreciate it if you could tell me how to solve it?</p>