Yeah that's correct. It's called docker compose. Everything is declarative and it can be stood up and torn down with a single command.
When I was setting myself up I referenced this project quite a bit:
https://github.com/DoTheEvo/selfhosted-apps-docker
You can pick and choose the parts you want.