From d260e671ee468ba21a06b82e4fa34790233d5d4a Mon Sep 17 00:00:00 2001 From: "John A. Barbuto" Date: Sun, 24 Jul 2016 16:39:07 -0700 Subject: [PATCH] Add build option to docker-compose up and wait for postgres to start https://github.com/docker/compose/issues/374 https://github.com/docker/compose/issues/693 --- README.md | 4 +++- bin/start-api | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 54075cd..b401103 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,9 @@ The steps here only need to be run once. 1. Bring up the development services - docker-compose up + docker-compose up --build + + The `--build` option ensures any new dependencies are included. 1. Open the development API diff --git a/bin/start-api b/bin/start-api index 3c97861..d194feb 100755 --- a/bin/start-api +++ b/bin/start-api @@ -1,5 +1,8 @@ #!/bin/sh -pip install -r requirements.txt -U +# Wait for postgres to start +# https://github.com/docker/compose/issues/374 +sleep 3 + python manage.py migrate gunicorn gettingstarted.wsgi --log-file - --reload --workers 2