From 97f2bb962a4cfb9c9bcfc1777a5973271b7de66b Mon Sep 17 00:00:00 2001 From: Sadiq Khoja Date: Mon, 2 Dec 2024 15:21:35 -0500 Subject: [PATCH] PR Feedback: - Start two instances of redis - remove readlink - use postgres service to create data dir and .postgres14-upgrade-successful --- Makefile | 1 - docker-compose.dev.yml | 7 +++++-- files/enketo/start-enketo.sh | 3 +-- files/postgres14/start-postgres.sh | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index d0e56b2e..c020af70 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,6 @@ .PHONY: dev dev: docker compose --profile central -f docker-compose.yml -f docker-compose.dev.yml up -d - docker compose exec postgres14 touch /var/lib/odk/postgresql/14/.postgres14-upgrade-successful .PHONY: stop stop: diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 6785e559..7f455bf9 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -13,7 +13,9 @@ services: network_mode: host postgres: profiles: - - none + - central + image: debian:bullseye + command: /bin/sh -c 'mkdir -p /var/lib/postgresql/14/data && touch /var/lib/postgresql/14/.postgres14-upgrade-successful' mail: profiles: - none @@ -53,6 +55,7 @@ services: network_mode: host enketo_redis_cache: profiles: - - none + - central + network_mode: host volumes: dev_secrets: \ No newline at end of file diff --git a/files/enketo/start-enketo.sh b/files/enketo/start-enketo.sh index 9c107a39..6b6d7055 100755 --- a/files/enketo/start-enketo.sh +++ b/files/enketo/start-enketo.sh @@ -5,8 +5,7 @@ echo "generating enketo configuration..." if [ "$ENV" = "DEV" ]; then sed -i -e 's/enketo_redis_main/localhost/g' \ - -e 's/enketo_redis_cache/localhost/g' \ - -e 's/6380/6379/g' "$CONFIG_PATH.template" + -e 's/enketo_redis_cache/localhost/g' "$CONFIG_PATH.template" fi BASE_URL=$( [ "${HTTPS_PORT}" = 443 ] && echo https://"${DOMAIN}" || echo https://"${DOMAIN}":"${HTTPS_PORT}" ) \ diff --git a/files/postgres14/start-postgres.sh b/files/postgres14/start-postgres.sh index 978f6c4c..972c6147 100755 --- a/files/postgres14/start-postgres.sh +++ b/files/postgres14/start-postgres.sh @@ -1,7 +1,7 @@ #!/bin/bash -eu set -o pipefail -flag_upgradeCompletedOk=$(readlink -f -m "$PGDATA/../.postgres14-upgrade-successful") +flag_upgradeCompletedOk="$PGDATA/../.postgres14-upgrade-successful" logPrefix="$(basename "$0")" log() {