-
Notifications
You must be signed in to change notification settings - Fork 12.1k
Description
Issue Summary
While setting up the project locally with yarn dx, the PostgreSQL container (prisma-postgres-1) fails to start and keeps restarting. The root cause is that the volume in
packages/prisma/docker-compose.yml is mounted at /var/lib/postgresql/data, but Postgres 18 no longer uses that path — it now stores data under /var/lib/postgresql/18/main (see docker-library/postgres#1259).
This means the volume mount needs to be at /var/lib/postgresql instead, so the data actually gets persisted.
Steps to Reproduce
- Clone the repo and run yarn install
- Run yarn dx
- @calcom/prisma#db-up fails — the postgres container is marked unhealthy
- Running docker logs prisma-postgres-1 shows the error about incompatible data directory
Actual Results
The container goes into a restart loop. Logs show:
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).
Counter to that, there appears to be PostgreSQL data in:
/var/lib/postgresql/data (unused mount/volume)
The suggested container configuration for 18+ is to place a single mount
at /var/lib/postgresql
Expected Results
yarn dx should start postgres without issues and data should persist across restarts.
Technical details
- macOS, Docker Desktop
- Postgres 18 (as specified in the docker-compose file)
- Upstream reference: docker-library/postgres#1259
The fix is a one-liner in
packages/prisma/docker-compose.yml
Existing users would also need to clear the old volume with docker compose -f packages/prisma/docker-compose.yml down -v before restarting.
Evidence
After applying the fix, the container starts fine:
$ docker ps --filter "name=prisma"
NAMES STATUS PORTS
prisma-postgres-1 Up 35 seconds (healthy) 0.0.0.0:5450->5432/tcp
Happy to open a PR for this.