

That’s working as intended; as the compose docs state, the command passed by run
overrides the command defined in the service configuration, so it wouldn’t normally be possible to actually shut down all the containers and then use docker compose run
to interact with one of them. Run doesn’t start anything up in the container other than the command you pass to it.
I’m not familiar with funkwhale, but they probably meant either to (a) shut down all the containers except postgres so that running pg_dump
has something to connect to, or (b) use exec
as you have done.
Personally, I do what you did, and use exec
most of the time to do database dumps. AFAIK, postgres doesn’t require that all other connections to it are closed before using pg_dump
. It begins a transaction at the time you run it, so it’s not interfering with anything else going on while it produces output (see relevant SO answer here). You could probably just leave your entire funkwhale stack up when you use docker compose exec
to run pg_dump
.
Additionally, why does age have anything to do with any of these questions? This feels like it was made by someone who doesn’t have much experience with other humans and is unaware of the massive variety of opinions and attitudes among all age groups.