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