FROM hashicorp/vault:1.21.3

COPY config /vault/config
COPY entrypoint.sh /vault/entrypoint.sh
RUN chmod +x /vault/entrypoint.sh

EXPOSE 8200 8201

HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 CMD VAULT_ADDR=http://127.0.0.1:8200 vault status >/dev/null 2>&1 || exit 1

ENTRYPOINT ["/vault/entrypoint.sh"]
