Skip to content

Commit 066dd9e

Browse files
make healthcheck variable
Context of remote docker compose health check not being supported
1 parent b5ef76b commit 066dd9e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

docker-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ services:
106106
hostname: db
107107
restart: always
108108
healthcheck:
109-
test: [ "CMD-SHELL", "pg_isready", "-d", "db_prod" ]
109+
test: ${HEALTHCHECK_TEST}
110110
interval: 30s
111111
timeout: 60s
112112
retries: 5

install.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,13 +524,14 @@ def populate_env(self):
524524
env_file += f"RABBITMQ_PORT={self.rabbit_port}\n"
525525

526526
if self.local_database:
527-
env_file += "POSTGRES_IMAGE=postgres:12.5\n"
527+
env_file += "POSTGRES_IMAGE=postgres:16\n"
528528
env_file += "DATABASE_URL=postgresql+psycopg2://postgres:postgres@db/diffgram\n"
529529
env_file += "DATABASE_NAME=diffgram\n"
530530
env_file += "DATABASE_HOST=db\n"
531531
env_file += "DATABASE_NAME=diffgram\n"
532532
env_file += "DATABASE_USER=postgres\n"
533533
env_file += "DATABASE_PASS=postgres\n"
534+
env_file += f"HEALTHCHECK_TEST='['CMD-SHELL', 'pg_isready', '-d', 'db_prod']'\n"
534535

535536
else:
536537
env_file += "POSTGRES_IMAGE=tianon/true\n"
@@ -539,6 +540,7 @@ def populate_env(self):
539540
env_file += f"DATABASE_NAME={self.db_name}\n"
540541
env_file += f"DATABASE_USER={self.db_username}\n"
541542
env_file += f"DATABASE_PASS={self.db_pass}\n"
543+
env_file += f"HEALTHCHECK_TEST='['CMD-SHELL', 'echo', 'Remote db in use. Health check not supported yet.']'\n"
542544

543545
if self.mailgun:
544546
env_file += f"MAILGUN_KEY={self.mailgun_key}\n"

0 commit comments

Comments
 (0)