Use Up When
You want your application stack running continuously.
You need attached logs, dependency startup, and normal service orchestration.
When to start a service stack and when to launch a one-off command with Compose.
`docker compose up` starts long-lived services from your compose file. `docker compose run` launches a one-off container for a service, usually for tasks like migrations, shells, or admin commands.
You want your application stack running continuously.
You need attached logs, dependency startup, and normal service orchestration.
You need a one-time command inside a service definition.
You are running migrations, opening a shell, or executing an ad hoc task.
Up starts the environment. Run does one job inside it.