Docker fails to find subdirectories

I am following the provided tutorial to develop a python web app.

When I run

docker-compose run -d --rm --no-deps app python create_db

I see my app is hosted at

However when I view the app, it looks like this:

I looked inside the Chrome Console and found resources weren’t found:


What is confusing is that my Dockerfile is set up to copy all my local files (including the img directory) into the src directory.

ADD . /src

My question is this,

Why are my pages unable to find their dependencies? If /src is set as the working directory, why isn’t my container able to find the img directory?


When you run the container it looks like in the Compose file they are bind mounting ./app into /src in the container: Does ./app in your project directory contain the correct files?

If bind mounts are specified like this, it doesn’t matter what gets baked into the container’s /src during build time. It will be over-written by whatever is in the host filesystem ./app at runtime.

The example tutorial doesn’t say anything about “NFL Crime Stats” ( is the main page), so I’m guessing you’ve actually deviated from the tutorial material and are maybe trying to run your own app? You will need to ensure that the container can access the img directory correctly.

It’s hard to say exactly what’s wrong without more information or a reproducible example.