'docker container for Django hangs when updating mounting sources

As part of a course I am currently passing there is a situation when following combination is used:

A docker container is created for very standard scenario: One for Django, second one for Postgresql database and then a compose file is managing all this stuff. And the sources are actually mounted using the docker-compose volumes.

The entire application I created during the course is available in my github: https://github.com/arsenhakobyan/recipe-app-api

The problem I faced is with running django test command each time when I update any source file.

steps to reproduce the issue I have:

  1. build images with docker-compose build
  2. run the following command: docker-compose run --rm app sh -c "python manage.py test"
  3. The process should run as expected.
  4. Edit any file (e.g. app->user->tests->test_user_api.py) and save the changes
  5. run the command from step 2. the process hangs at this point in my case and I can not even force to remove the docker containers, even tried to deactivate some endpoints from the network that is connected with that containers (I think that could help when I read some of the error messages). The only way to continue work is to restart the docker exe on my machine.

Let me know if that would be preferable to copy some code or file content here.

a little bit information regarding the machine and docker versions: machine: Machbook Pro, MacOS Moterey version 12.3.1 docker: Docker Desktop 4.8.2 (79419) docker-compose version 1.29.2, build 5becea4c

UPDATE: I have tested the same project on Linux machine and it works as expected.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source