Docker and CI/CD · Middle · Question 51 of 75
How can integration tests in GitHub Actions get a real PostgreSQL?
- 1Install PostgreSQL on the developer's laptop first
- ✓Correct answer: Declare it under
services:; it runs as a side container - 3Replace the database with mocks; real ones can't run
Explanation
Service containers start before the steps and are reachable on mapped ports (or by name when the job runs in a container). Health options make the job wait for readiness.