Skip to content Skip to sidebar Skip to footer

Docker Flask - Jinja2.exceptions.templatenotfound: Index.html

New to docker and trying to run a flask mysql app but getting a jinja2.exceptions.TemplateNotFound: index.html . No errors if I run python app.py outside of docker Directory struc

Solution 1:

Your Dockerfile only copies requirements.txt and app.py into the image. In order for the dockerized app.py to have access to templates and its contents, you need to copy templates as well by adding the line:

COPY templates /app/

Post a Comment for "Docker Flask - Jinja2.exceptions.templatenotfound: Index.html"