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.
This commit is contained in:
parent
0f613b21a6
commit
828dd82dd3
1 changed files with 2 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue