From ef95f410a32848acb038aef7d7b742f5f53dae15 Mon Sep 17 00:00:00 2001 From: Dimitris Galanis Date: Tue, 10 May 2022 15:25:37 +0300 Subject: [PATCH] Make sure Vault service is up before unsealing, closes mist.api#196 --- docker-compose.yml | 12 +++++++----- docker/vault/Dockerfile | 2 ++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 52cb1d6321..53254b594f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -93,7 +93,7 @@ services: hubshell: <<: *backend command: bin/wait-all bin/hubshell - + api: <<: *backend command: bin/wait-all bin/uwsgi @@ -239,17 +239,19 @@ services: vault-init: depends_on: - - vault + - vault image: $IMG_REGISTRY/vault:$IMG_TAG volumes: - vault-config:/vault/config:rw - vault-policies:/vault/policies:rw - approle:/approle - entrypoint: /init/vault-init.sh - + entrypoint: [ "/bin/sh", "-c" ] + command: + - | + /bin/wait-for vault:8200 + /init/vault-init.sh sh /etc/init.d/vault-play.sh environment: - VAULT_ADDR=http://vault:8200 - command: sh /etc/init.d/vault-play.sh volumes: elasticsearch: {} diff --git a/docker/vault/Dockerfile b/docker/vault/Dockerfile index fa7630db8a..d6d47584dc 100644 --- a/docker/vault/Dockerfile +++ b/docker/vault/Dockerfile @@ -1,4 +1,6 @@ FROM vault:latest RUN apk add vim grep socat jq +RUN wget -O /bin/wait-for https://github.com/eficode/wait-for/releases/download/v2.2.3/wait-for \ + && chmod +x /bin/wait-for COPY ./init /init COPY vault-start.sh /vault-start.sh