From 61ac64401019ff0199df74a63bed66ea82404c50 Mon Sep 17 00:00:00 2001 From: marax Date: Thu, 4 Nov 2021 16:23:27 +0100 Subject: [PATCH] Modified docker-compose file and django to include wait_for_db --- docker-compose.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 55133b2..02a14bd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,6 +15,10 @@ services: django: build: ./docker_django + command: > + sh -c "python manage.py wait_for_db && + python manage.py migrate && + python manage.py runserver 0.0.0.0:8000" restart: always volumes: - /vagrant:/etc/project @@ -22,6 +26,4 @@ services: - 80:8000 depends_on: - db - command: > - sh -c "python manage.py runserver 0.0.0.0:8000"