Compose looks for its file in the current folder. In a cron job or a script that is rarely the right one, and a cd that fails silently can make the next command run against the wrong project.
docker compose --project-directory /srv/app ps
docker compose --project-directory /srv/app pull
docker compose --project-directory /srv/app up -d
With --project-directory, Compose treats that folder as the working directory. It finds compose.yaml, the .env file and any override file there, and relative paths in the file resolve from it, just as if you had run the command inside the folder.
The alternative -f /srv/app/compose.yaml also works, but it does not load compose.override.yaml automatically. That difference is why I prefer the project directory flag in scripts; the stack then behaves the same as when you type the command by hand.
The project name still comes from the folder name unless the file sets name:. If two folders share a name, such as two copies called app, they would fight over the same containers. Keep the option before the subcommand, as above, since it is a global flag.
Further reading: docker compose