.dockerignore not used properly in `docker-compose`
It appears there is a difference between how docker build
and docker-compose up
treat .dockerignore
. It is related to upstream issues such as https://github.com/docker/compose/issues/1607, and is not something we can immediately fix. However, this does mean we need to pay some attention to this when building images, especially ones we're pushing to public places.
Because of this, the build context is larger than necessary in directories that include e.g. .tox
and .git
, as well as large files in website/media/
. Additionally, any files in website/media/
added to the image, increasing its size unnecessarily. More importantly, we should be careful not to leak any secrets (or private data of members!) by including db.sqlite3
or localsettings.py
files.
Perhaps we can work around some of the issues by editing .dockerignore
.