From e1c39536fc445aa6f88617bf852f8f41b0fc724f Mon Sep 17 00:00:00 2001 From: njuguna-n <141340177+njuguna-n@users.noreply.github.com> Date: Fri, 19 Apr 2024 16:40:59 +0300 Subject: [PATCH] feat: bind sequence token path to host for persistence (#88) * feat: bind sequence token path to host for persistence --- .gitignore | 1 + docker-compose.override.yml | 11 +++++++++++ logstash/entrypoint.sh | 1 + 3 files changed, 13 insertions(+) create mode 100644 docker-compose.override.yml diff --git a/.gitignore b/.gitignore index d9d2214..053c3c8 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ node_modules .idea */coverage/* +logstash/sequence_path.txt diff --git a/docker-compose.override.yml b/docker-compose.override.yml new file mode 100644 index 0000000..f08357f --- /dev/null +++ b/docker-compose.override.yml @@ -0,0 +1,11 @@ +version: '3.7' + +services: + logstash: + image: medicmobile/cht-logstash-couchdb:latest + build: ./logstash/ + restart: always + volumes: + - type: bind + source: ./logstash + target: /tmp/couchdb diff --git a/logstash/entrypoint.sh b/logstash/entrypoint.sh index 67c4b75..4c0d9a4 100644 --- a/logstash/entrypoint.sh +++ b/logstash/entrypoint.sh @@ -15,6 +15,7 @@ rm "${TEMPLATE_FILE}" if [[ -f "${COUCHDB_SEQ}" && -s "${COUCHDB_SEQ}" ]]; then echo "Using existing sequence file" + echo "Current sequence: $(cat ${COUCHDB_SEQ})" else mkdir -p `dirname ${COUCHDB_SEQ}` \ && chown -R $USER.$USER `dirname ${COUCHDB_SEQ}` \