How my use of Docker grew from running a local application to supporting a reproducible development and CI workflow. Using a FastAPI service and Postgres, I work through building images and introducing multistage builds.
Takeaways
- Use Compose to bring up the FastAPI app and Postgres together, then run tests in the same environment instead of asking each developer to install a matching database and Python toolchain.
- Split the Dockerfile into development and production stages. They can share a base without shipping test tools in the production image.
Further reading
- Running Python tests with Compose in GitLab CI shows how to carry that local setup into a CI job.
Resources
TALK RECORDING
Photo from conference
