From 40617b7cfe723d8afd440ae3034ca74ceb9fa0de Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Fri, 3 Nov 2023 12:01:12 +0100 Subject: [PATCH 1/3] add creating initial datas --- docker/idhub.entrypoint.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docker/idhub.entrypoint.sh b/docker/idhub.entrypoint.sh index 60e990e..f1f05fe 100755 --- a/docker/idhub.entrypoint.sh +++ b/docker/idhub.entrypoint.sh @@ -17,6 +17,9 @@ main() { # move the migrate thing in docker entrypoint # inspired by https://medium.com/analytics-vidhya/django-with-docker-and-docker-compose-python-part-2-8415976470cc ./manage.py migrate + + printf "creating initial Datas\n" >&2 + python initial_datas.py #./manage.py collectstatic printf "creating superuser \n user: ${DJANGO_SUPERUSER_USERNAME}\n password: ${DJANGO_SUPERUSER_PASSWORD}\n email: ${DJANGO_SUPERUSER_EMAIL}\n" >&2 From fd3014afd7b78cc4bf92b7fb5af8091b094c4236 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Fri, 3 Nov 2023 13:28:17 +0100 Subject: [PATCH 2/3] add creating initial datas as command --- docker/idhub.entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/idhub.entrypoint.sh b/docker/idhub.entrypoint.sh index f1f05fe..a2cbc22 100755 --- a/docker/idhub.entrypoint.sh +++ b/docker/idhub.entrypoint.sh @@ -19,7 +19,7 @@ main() { ./manage.py migrate printf "creating initial Datas\n" >&2 - python initial_datas.py + ./manage.py initial_datas #./manage.py collectstatic printf "creating superuser \n user: ${DJANGO_SUPERUSER_USERNAME}\n password: ${DJANGO_SUPERUSER_PASSWORD}\n email: ${DJANGO_SUPERUSER_EMAIL}\n" >&2 From be4e1dc7004c5ee2c9161b9de8f96323203d964a Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Fri, 3 Nov 2023 13:52:44 +0100 Subject: [PATCH 3/3] add docker_down --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 0f5c92e..00336af 100644 --- a/Makefile +++ b/Makefile @@ -50,3 +50,6 @@ docker_publish: docker: $(MAKE) docker_build $(MAKE) docker_publish + +docker_down: + docker compose down -v