From 828dd82dd397c19b99db89d76882d9e76ca314fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20M=C3=B6rling?= Date: Tue, 19 May 2026 19:57:58 +0200 Subject: [PATCH] fix: use tmpfs for postgres data in E2E compose to prevent Flyway checksum mismatches The postgres:16 image declares a VOLUME for /var/lib/postgresql/data. Docker Compose creates an anonymous volume that persists across CI runs. When a Flyway migration file is modified, the next run sees a checksum mismatch because the old migration is already recorded in the schema_history table in the stale volume. - Add tmpfs: [/var/lib/postgresql/data] to the postgres service - This keeps data in RAM only, guaranteeing a completely fresh database on every E2E run with no persistent state between invocations Result: eliminates FlywayValidateException caused by migration checksum mismatches in CI. --- docker-compose.e2e.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker-compose.e2e.yml b/docker-compose.e2e.yml index 6dfd8b4..710d88f 100644 --- a/docker-compose.e2e.yml +++ b/docker-compose.e2e.yml @@ -12,6 +12,8 @@ services: POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} networks: - e2e + tmpfs: + - /var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"] interval: 5s