From 9a2d20ff9b2632c891cf1c0fb290024d23cba20c Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Wed, 15 Jun 2022 19:47:53 +0200 Subject: [PATCH 1/2] Local development: use `nodemon` to watch files instead of `watchmedo` We have been dealing with a problem with `watchmedo` that restart the process when it shouldn't be restarted and it doesn't restart it when it should. I got tired debugging `watchmedo` and I was suggested to give it a try to `nodemon` because we are already using it in other projects. I'm not super happy adding a node dependency to the Dockerfile, but I didn't find a better way to do it. I did some tests with the configuration proposed and it seemed to work pretty well. I'm sure we will find some edge cases, but we always can tune it a little more later. Closes https://github.com/readthedocs/readthedocs.org/issues/8802 --- dockerfiles/Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dockerfiles/Dockerfile b/dockerfiles/Dockerfile index a8e45a457b6..b1644c06636 100644 --- a/dockerfiles/Dockerfile +++ b/dockerfiles/Dockerfile @@ -29,7 +29,8 @@ RUN apt-get -y install \ sqlite \ netcat \ telnet \ - lsb-release + lsb-release \ + npm # Gets the MinIO mc client used to add buckets upon initialization # If this client should have issues running inside this image, it is also @@ -38,6 +39,8 @@ RUN apt-get -y install \ RUN curl -s -q https://dl.min.io/client/mc/release/linux-amd64/archive/mc.RELEASE.2022-06-11T21-10-36Z -o /usr/bin/mc && \ chmod +x /usr/bin/mc +RUN npm install -g nodemon + # Uncomment en_US.UTF-8 locale and generate it RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \ locale-gen From a359b8ebe76ddd1ca2991840fc0efcf245823965 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Wed, 15 Jun 2022 20:06:09 +0200 Subject: [PATCH 2/2] Local development: remove `watchdo` Python package It's not required anymore since we are using `nodemon` now. --- requirements/docker.txt | 5 ----- 1 file changed, 5 deletions(-) diff --git a/requirements/docker.txt b/requirements/docker.txt index 9df7462bc98..fc5708aaabc 100644 --- a/requirements/docker.txt +++ b/requirements/docker.txt @@ -11,11 +11,6 @@ django-redis-cache==3.0.1 # For resizing images pillow==9.1.0 -# Local debugging tools -watchdog==2.1.7 -# watchdog dependency -argh==0.26.2 - # run tests tox==3.25.0