Adding a dynamic way to include arbitrary dependencies of Wagtail
Fixes #4
Hey @saevarom, thank you for this! Tested locally and it is working mostly great.
A few things:
- I have
django-modelclusterin libs. so had todocker compose exec web bashandpip install -e /code/libs/django-modelcluster - Ditto, had to get into the web container and
pip install -U django-taggitto make it work with the latest bakerydemo. Will try from scratch, rather than on top of existing install tomorrow morning - 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
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.
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
🌟
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: