docker-wagtail-develop icon indicating copy to clipboard operation
docker-wagtail-develop copied to clipboard

Adding a dynamic way to include arbitrary dependencies of Wagtail

Open saevarom opened this issue 3 years ago • 4 comments

Fixes #4

saevarom avatar Jun 20 '22 20:06 saevarom

Hey @saevarom, thank you for this! Tested locally and it is working mostly great.

A few things:

  1. I have django-modelcluster in libs. so had to docker compose exec web bash and pip install -e /code/libs/django-modelcluster
  2. Ditto, had to get into the web container and pip install -U django-taggit to make it work with the latest bakerydemo. Will try from scratch, rather than on top of existing install tomorrow morning
  3. Had to add the following:
diff --git a/.dockerignore b/.dockerignore
index 4b67e1f..44c04d0 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -8,3 +8,8 @@
 **/Vagrantfile
 **/.devcontainer
 **/.vscode
+**/.tox
+**/build/
+**/dist/
+**/venv/
+**/.venv/

in order to avoid copying a couple of GB of context because of package tox envs or venvs

zerolab avatar Jun 20 '22 22:06 zerolab

Thanks!

Regarding 1. and 2. Did you do a docker compose build web after switching to this branch? I assumed that would rebuild the container with the contents of your /libs pip installed.

Regarding 3, we definitely should augment the .dockerignore with these lines to avoid copying all that data.

saevarom avatar Jun 20 '22 22:06 saevarom

I did docker compose build. Checked again looking carefully at the very fast moving install lines and.. it looks like one of the libraries that I have has a dependency on an older Wagtail version, so that ends up installing that Wagtail version, thus modelcluster.

So this would happen even if one were to do this manually, or alter the Dockerfile to directly install the deps.

Augmenting .dockerignore is the only thing needed, imho

🌟

zerolab avatar Jun 20 '22 23:06 zerolab

Just realised I also have

diff --git a/docker-compose.yml b/docker-compose.yml
index 63e6618..346c229 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -13,6 +13,7 @@ services:
     restart: "no"
     volumes:
       - ./wagtail:/code/wagtail:delegated,rw
+      - ./libs:/code/libs:delegated,rw
       - ./bakerydemo:/code/bakerydemo:delegated,rw
       - node_modules:/code/wagtail/node_modules/
     ports:

zerolab avatar Oct 05 '22 09:10 zerolab