This is an extracted and reworked part of #6588

>From the github actions runs, you can see the difference - when the db 
>container is being started, the web container waits until the db is `healthy`

before:

```
 Container openstreetmap-website-db-1  Creating
 Container openstreetmap-website-db-1  Created
 Container openstreetmap-website-web-1  Creating
 Container openstreetmap-website-web-1  Created
 Container openstreetmap-website-db-1  Starting
 Container openstreetmap-website-db-1  Started
 Container openstreetmap-website-web-1  Starting
 Container openstreetmap-website-web-1  Started
```

after:

```
 Container openstreetmap-website-db-1  Creating
 Container openstreetmap-website-db-1  Created
 Container openstreetmap-website-web-1  Creating
 Container openstreetmap-website-web-1  Created
 Container openstreetmap-website-db-1  Starting
 Container openstreetmap-website-db-1  Started
 Container openstreetmap-website-db-1  Waiting
 Container openstreetmap-website-db-1  Healthy
 Container openstreetmap-website-web-1  Starting
 Container openstreetmap-website-web-1  Started
```

It's unclear if the lack of healthcheck was a genuine problem, but I think 
this PR implements a reasonable thing to do. Compared to the original PR, the 
`pg_isready` command is simplified since the additional options are unnecessary 
and it outputs useful exit-codes without any additional handling.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/6626

-- Commit Summary --

  * Use a healthcheck to ensure the docker db container is active

-- File Changes --

    M docker-compose.yml (8)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/6626.patch
https://github.com/openstreetmap/openstreetmap-website/pull/6626.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6626
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/[email protected]>
_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to