Skip to content

Commit

Permalink
Fix missing postgres env vars and add sleep 🤷
Browse files Browse the repository at this point in the history
  • Loading branch information
mbarton committed Jan 6, 2025
1 parent 1382cc7 commit 6447995
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 17 deletions.
5 changes: 0 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ services:
volumes:
- postgis-data:/var/lib/postgresql/data
restart: always
healthcheck:
test: pg_isready
interval: 1s
timeout: 5s
retries: 30

mkdocs:
<<: *django # this will inherit all the settings from the django service
Expand Down
12 changes: 7 additions & 5 deletions envs/example.env
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ DJANGO_STARTUP_COMMAND="python manage.py runserver 0.0.0.0:8003" # for local dev
RCPCH_NHS_ORGANISATIONS_SECRET_KEY="mysecretkey"

# DJANGO POSTGRES DATABASE CONNECTION
PGDATABASENAME="nhsorganisationsdb"
PGUSER="nhsorganisationsuser"
PGPASSWORD="password"
PGHOST="postgis"
PGPORT="5432"
POSTGRES_DB="nhsorganisationsdb"
POSTGRES_USER="nhsorganisationsuser"
POSTGRES_PASSWORD="password"
POSTGRES_HOST="postgis"
POSTGRES_PORT="5432"



# EMAIL
EMAIL_DEFAULT_FROM_EMAIL="########"
Expand Down
10 changes: 5 additions & 5 deletions rcpch_nhs_organisations/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@
DATABASES = {
"default": {
"ENGINE": "django.contrib.gis.db.backends.postgis",
"NAME": os.environ.get("PGDATABASENAME"),
"USER": os.environ.get("PGUSER"),
"PASSWORD": os.environ.get("PGPASSWORD"),
"PORT": os.environ.get("PGPORT"),
"HOST": os.environ.get("PGHOST"),
"NAME": os.environ.get("POSTGRES_DB"),
"USER": os.environ.get("POSTGRES_USER"),
"PASSWORD": os.environ.get("POSTGRES_PASSWORD"),
"PORT": os.environ.get("POSTGRES_PORT"),
"HOST": os.environ.get("POSTGRES_HOST"),
}
}

Expand Down
5 changes: 3 additions & 2 deletions s/pr-check
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash -e

# s/up --detach --wait
s/up
s/up --detach
# I tried --wait and a healthcheck but still got connection refused from postgres
sleep 5
s/test

0 comments on commit 6447995

Please sign in to comment.