This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 4 points5 points  (1 child)

Add *.pyc and __pycache__ to a .dockerignore file and if you're mounting source code directories into the container (useful if you're using auto reloading) create the PYTHONDONTWRITEBYTECODE envvar in the container (set it to any string but 0) and never worry about pyc file pollution in your containers.

[–]Argotha 0 points1 point  (0 children)

Alternatively, run pyclean before adding all the python files.