From 3fe571c32bd8346c99d0f6aad16e13884d6da8b2 Mon Sep 17 00:00:00 2001 From: Piotr Dobrowolski Date: Wed, 10 May 2017 01:22:56 +0200 Subject: [PATCH] Fix up dockerfile... --- Dockerfile | 1 + docker-compose.yml | 4 ++-- postgres-hstore/create_extension.sh | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index b80d6d8..0646f4f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,4 +6,5 @@ RUN apt-get -y update RUN apt-get -y install libsasl2-dev libldap2-dev libssl-dev ADD requirements.txt /code/ RUN pip install -r requirements.txt +RUN wget https://github.com/vishnubob/wait-for-it/raw/55c54a5abdfb32637b563b28cc088314b162195e/wait-for-it.sh -O /usr/local/bin/wait-for-it && chmod +x /usr/local/bin/wait-for-it ADD . /code/ diff --git a/docker-compose.yml b/docker-compose.yml index b370e13..bf1e35f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,11 +1,11 @@ -version: '2' +version: "3" services: db: build: postgres-hstore web: build: . - command: /bin/bash -c "python manage.py migrate && python manage.py runserver 0.0.0.0:8000" + command: wait-for-it db:5432 -- bash -c "python manage.py migrate && python manage.py runserver 0.0.0.0:8000" volumes: - .:/code ports: diff --git a/postgres-hstore/create_extension.sh b/postgres-hstore/create_extension.sh index 65e36b1..f28bdbe 100644 --- a/postgres-hstore/create_extension.sh +++ b/postgres-hstore/create_extension.sh @@ -3,7 +3,7 @@ # # Running CREATE EXTENSION in both template1 and postgres can lead to # the extensions having different eid's. -gosu postgres psql --dbname template1 <