libredb / libredb/libredb-studio

[BUG] docker/postgres.yml restart-loops on postgres:18 because of the data volume mount path

Open
#792 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
726
Forks
119
Avg merge
7h 47m
Merged PRs (30d)
265

Description

`docker/postgres.yml` cannot start on `postgres:18`. The service declares

```yaml
image: postgres:18
volumes:
- libredb_postgres_data:/var/lib/postgresql/data
```

The PostgreSQL 18 official image moved its data directory handling: the volume the image expects is `/var/lib/postgresql`, and mounting over `/var/lib/postgresql/data` leaves the container restart-looping. The effect is that nobody can bring up this repo's documented PostgreSQL development database, and therefore nobody can apply `docker/postgres-init/*.sql`, which is the only seed script this repo has for any engine.

Found while working on #789, by an agent that needed the seed applied and could not get it. It verified its work against a throwaway container on an alternate port instead. Filed separately because the fix is one line in a file that branch does not otherwise touch.

Two adjacent facts worth folding into the same change:

1. `database-compose.yml`'s `postgres` service mounts no init scripts at all, so even when it starts it never applies `docker/postgres-init/`. The two compose files disagree about what a development PostgreSQL is.
2. Both files hardcode `container_name: libredb-postgres` and `5432:5432`, so they collide with each other and with any PostgreSQL a contributor already runs on the default port. Parameterising the host port and the container-name prefix, defaulting to today's values, would let a contributor bring the fleet up without stopping their own database.

Reproduce:

```
docker compose -f docker/postgres.yml up -d
docker compose -f docker/postgres.yml ps
```

Contributor guide

Open the contributing guide

Research direction

Start with docker/postgres.yml and reproduce the restart loop using the documented docker compose command, then compare it with database-compose.yml and inspect docker/postgres-init/*.sql. Done means PostgreSQL 18 starts, the seed scripts are applied consistently by both development compose setups, and the container name and host port can be overridden while retaining today's defaults.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, postgresql
Domain
databases, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.