title: Unable to Return Static files [404] Flask App Running in Docker (Ubuntu) Container
body: <p>I have a Flask application, which uses static files such as 'font.ttf' stored within '/app/static/fonts/' in container directory.</p>
  
  <p>The application functions correctly when running on Python in windows for development, and is able to retrieve the files. However when placed into a Ubuntu Docker container it launches the web-page and basic html, but is unable to serve static files which go with the web-page.</p>
  
  <p>Example error:</p>
  
  <pre><code>GET http://192.168.1.200:5000/static/fonts/Pacifico-Regular.ttf net::ERR_ABORTED 404 (NOT FOUND)
  </code></pre>
  
  <p>I have the following startup parameters for the flask application.</p>
  
  <pre><code>app = Flask(__name__, static_url_path='', static_folder=os.path.abspath('/app/static/'))
  </code></pre>
  
  <p><strong>Why is it unable to return the static files?</strong></p>
  
  <p>Reference Folder Structure:</p>
  
  <pre><code>app
  ├───static
  │   ├───css
  │   ├───fonts
  │   ├───js
  │   │   └───lib
  │   └───media
  └───templates
  </code></pre>
  
  <p>Dockerfile:</p>
  
  <pre><code>FROM ubuntu:latest
  RUN apt-get update -y
  RUN apt-get install -y python-pip python-dev build-essential
  RUN apt-get install -y unixodbc-dev
  
  COPY . /app
  WORKDIR /app
  
  RUN pip install flask
  RUN pip install pyodbc
  
  ENTRYPOINT ["python"]
  CMD ["app.py"]
  </code></pre>
  
  <p>Docker Run:</p>
  
  <pre><code>docker run -d -p 5000:5000 flask-app:latest
  </code></pre>
  
  <p><strong>Many Thanks</strong></p>