TOOL » VIRTUAL_ENVIRONMENT » DOCKER_COMPOSE

Run

Usage

Run a one-off command on a service.

shell
docker-compose run OPTIONS SERVICE COMMAND
OptionDescription
-d --detachDetached mode: Run container in the background.
-e --envSet an environment variable (can be used multiple times).
--nameAssign a name to the container.
-T --no-TTYDisable pseudo-tty allocation.
--rmRemove container after run.
-u --userRun as specified username or uid.
-w --workdirWorking directory inside the container.

Example

Run a command with an environment variable.

shell
docker-compose run -e DEBUG=1 app bash