Closed cantchooseaname8 closed 2 months ago
For a Git Repo based Stack, the run directory should be relative to to the root of the Git repo.
For example, this is a repo holding some compose files for the demo, eg immich.compose.yaml: https://git.demo.monitor.dev/mbecks/demo-sync
The run directory for this repo should just be .
or ./
since the compose files are in the root folder of the git repo.
Monitor can just cd <repo_dir> && docker compose -f immich.compose.yaml up -d
. And in line with this, the File Path should be immich.compose.yaml
or ./immich.compose.yaml
.
Even if you have the file in some folder in the repo, you can usually leave the run directory as ./
, and instead just change the File Path to ./folder_name/immich.compose.yaml.
But what if you have a Monorepo with maybe some code in it, and in Extra Args you add --build
?
This will tell Monitor to clone the repo, build the code into an image, and then deploy the stack. Docker builds depend on build context, which depends on the current working directory of where the command is called. For this reason, Monitor provides this custom Run Directory feature, to change to the correct working directory to run the docker compose command, and build the images correctly.
If this is not your intention, just leave the Run Directory as ./
and specify the relative path to the compose file as I described above.
For reference, the general form of the compose command Monitor generates from the config is:
cd <REPO_PATH>/<RUN_DIRECTORY> && docker compose -f <FILE_PATH> up -d <EXTRA_ARGS>
Hope this helps!
Makes sense. Thanks for the explanation. I'm still learning all of this, but I appreciate your help (both here and on reddit)
When pulling from GitHub, having a leading "." in the run directory causes it to fail when deploying. Removing the "." without making any other changes makes it work just fine. Here's a screenshot of where I'm referring to.