Commit 7980fa5
committed
fix: pin postgres image version; fix default db host in lando's compose.yml
The former fixes some issues when postgres 18 is used AFAICT; 17 is what is used in prod: https://github.com/mozilla-services/cloudops-infra/blob/master/projects/lando/tf/modules/postgres/variables.tf#L10-L12
Errors I was seeing were:
```
~/repos/lando main ?1 ❯ make test х INT
/usr/bin/docker compose run --rm lando lando tests
WARN[0000] The "UID" variable is not set. Defaulting to a blank string.
WARN[0000] The "GID" variable is not set. Defaulting to a blank string.
[+] Creating 1/1
✔ Container lando-redis-1 Running 0.0s
[+] Running 1/1
✔ Container lando-db-1 Started 0.2s
dependency failed to start: container lando-db-1 exited (1)
make: *** [Makefile:35: test] Error 1
~/repos/lando main ?1 ❯ docker logs lando-db-1
Error: in 18+, these Docker images are configured to store database data in a
format which is compatible with "pg_ctlcluster" (specifically, using
major-version-specific directory names). This better reflects how
PostgreSQL itself works, and how upgrades are to be performed.
See also docker-library/postgres#1259
Counter to that, there appears to be PostgreSQL data in:
/var/lib/postgresql/data (unused mount/volume)
This is usually the result of upgrading the Docker image without
upgrading the underlying database using "pg_upgrade" (which requires both
versions).
The suggested container configuration for 18+ is to place a single mount
at /var/lib/postgresql which will then place PostgreSQL data in a
subdirectory, allowing usage of "pg_upgrade --link" without mount point
boundary issues.
See docker-library/postgres#37 for a (long)
discussion around this process, and suggestions for how to do so.
```
The latter fixes a bug that I presume nobody else is hitting because they've overriden the db hostname in `.env`. Setting it in Lando's compose.yml seems to have no downsides.1 parent 56ede20 commit 7980fa5
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| |||
0 commit comments