From ad6daa35ccecf31959461e95ebfd846f6b516611 Mon Sep 17 00:00:00 2001 From: Stephan Porada Date: Wed, 23 Oct 2019 13:58:27 +0200 Subject: [PATCH] Add wait-for-it.sh --- Dockerfile | 3 +++ docker-entrypoint.sh | 1 + 2 files changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index e846ac41..1c55b5d9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,6 +23,9 @@ COPY config.py opaque.py requirements.txt ./ RUN python -m venv venv && \ venv/bin/pip install -r requirements.txt +# add wait for it +RUN git clone https://github.com/vishnubob/wait-for-it.git /wait-for-it +RUN chmod a+x /wait-for-it/wait-for-it.sh COPY docker-entrypoint.sh /usr/local/bin/ ENTRYPOINT ["docker-entrypoint.sh"] diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index f60f3f48..85e1acfe 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -1,5 +1,6 @@ #!/bin/sh +/wait-for-it/wait-for-it.sh db:5432 --strict --timeout=0 if [ $# -eq 0 ] then venv/bin/python -u opaque.py