title: Download file from Flask application running in Docker container
body: <p>I'm making a Flask application which runs in a Docker container. Everything works fine so far, but now I want to make a GET method, which should return a file to be downloaded by the user. For this, I've tried the Flask functions <code>send_file</code> and <code>send_from_directory</code>. They both work when I run my application as is, but as soon as I put it in a Docker container, things stop working.</p>
  
  <p>If I use <code>send_file</code>, I get a <code>file not found</code> error, although I can call <code>print(os.path.isfile)</code> using the same file path, and it will show up.</p>
  
  <p>If I used <code>send_from_directory</code> using the correct path and file name then I get instead a 404 error.</p>
  
  <p>Again, this is only when running from a Docker container. Could it be a permission issue?</p>
  
  <p>Example of method:</p>
  
  <pre><code>class DownloadLog(Resource):
      def get(self):
          print(os.path.isfile('logfile.log')  # Returns 'True'
          return send_from_directory('.', 'logfile.log')
  </code></pre>