fix(docker): move postgres data to a named volume, off the WSL2 bind mount

The ./data/postgres bind mount hit a WSL2/Docker Desktop bug where the
9p/virtiofs bridge reports normal postgres:postgres 0600 ownership but
the kernel still refuses the postgres user's own open() calls for
write — silent on read, fatal on any WAL write, which took the whole
database down after an unclean shutdown. Switches to a Docker-managed
named volume (bellsystems-postgres-data) that lives inside the WSL2
VM's own filesystem instead. The old bind-mounted data is left in
place at ./data/postgres/ as an untouched backup — that folder was
too wedged by the same bug to even rename, so it's abandoned rather
than deleted.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-21 18:36:28 +03:00
co-authored by Claude Sonnet 5
parent cef5e1f0f5
commit 751cac72ce
+15 -1
View File
@@ -50,7 +50,7 @@ services:
POSTGRES_USER: ${POSTGRES_USER} POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes: volumes:
- ./data/postgres:/var/lib/postgresql/data - postgres-data:/var/lib/postgresql/data
networks: networks:
- internal - internal
healthcheck: healthcheck:
@@ -62,3 +62,17 @@ services:
networks: networks:
internal: internal:
driver: bridge driver: bridge
volumes:
# Docker-managed volume (lives inside the WSL2 VM's own filesystem) instead
# of a ./data/postgres bind mount onto the Windows filesystem. The bind
# mount hit a WSL2/Docker Desktop bug where the 9p/virtiofs bridge reports
# normal postgres:postgres 0600 ownership but the kernel still refuses the
# postgres user's own open() calls for write — silent on read, fatal on any
# WAL write, which took the whole database down after an unclean shutdown.
# Migrated 2026-09-04; the old bind-mounted data is untouched at
# ./data/postgres/ as a backup (that folder itself was too wedged by the
# same bug to even rename — leave it alone; it's not used anymore).
postgres-data:
name: bellsystems-postgres-data
external: true