cookiecutter-django
cookiecutter-django copied to clipboard
Wrong option for postgres volume mounts in compose files
Both in the local.yml and production.yml compose file, the postgres mounts are defined like this
volumes:
- production_postgres_data:/var/lib/postgresql/data:Z
- production_postgres_data_backups:/backups:z
However, why is the z/Z option there?
docker-compose v2.4.1, even complains about this, reporting the following warning:
mount of type `volume` should not define `bind` option
That's because the syntax defines a volume mount but the z/Z option is for bind mounts and that's incompatible. Shouldn't the option be removed?
This was added as part of https://github.com/cookiecutter/cookiecutter-django/pull/2663 and I don't think I noticed any issues on macOs at the time... Which OS are you on? Maybe that's no longer applicable and should be reverted.
I use Arch Linux, so I'm on the latest Linux kernel and docker and docker-compose versions.
Reading the #2663 PR, I think it's actually a good idea to have them in the django service volumes in local.yml compose. but I don't think it even has any effect on the postgres service volumes, since it is an incompatible option. I think it's just ignored on non-SELinux platforms, and triggers an annoying warning on my setup (don't know if that's because of Linux or the latest Docker or docker-compose versions).
FWIW, I've started seeing this warning on macOS too