Environments
These commands run docker compose for you, against one project or a whole workspace. Each one works out what to act on from your current directory, or from -w and -p. See Choosing a workspace and project.
How orca runs compose
For each project, orca runs docker compose from the project's directory with:
- the project's
composeFiles.primary, - the overlay orca generates for it,
- each of the project's
envFiles, as--env-file, - a compose project name of
orca-{workspace}-{project}.
To see the exact command, run orca debug show-compose-command inside a project. It also works as a prefix for any compose command orca doesn't wrap:
orca debug show-compose-config shows the final config, after your compose file, the overlay and env files are merged together.
Starting and stopping
| Command | Runs |
|---|---|
orca up |
docker compose up -d |
orca down |
docker compose down --remove-orphans |
orca restart |
down, then up |
For a whole workspace, up starts projects in dependency order (projects before the ones that require them), and down stops them in reverse. See dependencies between projects. Projects you've disabled are skipped by up, unless an enabled project requires them.
Hooks
up and down run each project's up and down hooks, around starting and stopping it. For each project, in the order they're started:
- its
up.pre - the project is started
- its
up.post
Then the next project. down does the same, with the down hooks, in the order projects are stopped. The workspace repository's own project is no different from the others, and the workspace config has no up or down hooks.
A project's hooks only run when it's started or stopped. So a disabled project that's skipped doesn't run them, but one that's started anyway, as an enabled project requires it, does.
Any extension that you haven't trusted yet is asked about before anything starts or stops. --yes runs them all without asking, for that run only. A failing hook stops the command: a failing up.pre stops before its project starts, and a failing up.post fails the command, though its project is already started. restart asks about down's hooks, then up's.
Logs
orca logs follows a single project's logs (docker compose logs -f). Press Ctrl-C to stop.
Running commands in a service
$ orca exec app sh
$ orca exec app ls -la /app
$ orca exec -p web app sh # orca's flags go before the service
orca exec runs a command in one of a project's services:
- If the service is running, it uses
docker compose exec. - If it isn't, it uses
docker compose run --rm, starting a throwaway container.
Either way you get an interactive terminal. Everything after the service is passed to the container as it is, flags included, so orca's own flags, like -p, must come before the service. This is how docker compose exec works too.
Earlier versions took the service with -s, and needed -- before a command with flags, e.g. orca exec -s app -- ls -la. Drop both: orca exec app ls -la. A -- straight after the service is an error, rather than being passed to the container.
For commands you run often, define an extension instead.