services:
pg_test:
image: postgres:16-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: testpass
POSTGRES_DB: postgres
ports:
- "5432:5432" # expose to host for tests
healthcheck: # wait until the DB is ready
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 2s
timeout: 2s
retries: 15