···77import TabItem from '@theme/TabItem';
88import CodeBlock from '@theme/CodeBlock';
99import ComposeStack from '!!raw-loader!../../../compose.yaml';
1010+import ConsoleOutput from '../../src/components/QuickStartSnippets/consoleOutput.mdx'
1111+import TreeDirectory from '../../src/components/snippets/_directoryTree.mdx'
10121113## Docker
1214···45474648:::tip
47494848-See the [**Quick Start Guide**](../quickstart.mdx) for another guided docker-compose example
5050+Use the [**Quick Start Guide**](../quickstart.mdx) for an interactive setup!
49515052:::
5153···5456* You have [Komodo](https://komo.do/) already setup
5557* You have installed [Periphery](https://komo.do/docs/connect-servers) on a machine
5658 * The Komodo Server name for this machine is `my-cool-server`
5757- * The machine is currently using dockge and has all of its compose projects located at `/home/myUser/homelab` like...
5858- * `/home/myUser/homelab/immich`
5959- * `/home/myUser/homelab/plex`
6060- * etc...
5959+ * The machine is currently using dockge and its projects directory looks like this:
61606262-<Tabs groupId="runType" queryString>
6363- <TabItem value="docker" label="Docker">
6464- ```bash
6565- docker run --name komodo-import -e "SERVER_NAME=my-cool-server" -e "HOST_PARENT_PATH=/home/myUser/homelab" -v /home/myUser/homelab:/filesOnServer foxxmd/komodo-import
6666- ```
6767- </TabItem>
6868- <TabItem value="docker-compose" label="Docker Compose">
6969- See [`docker-compose.yml`](#docker) sample above for more options and annotations.
6161+<TreeDirectory/>
70627171- ```yaml title="docker-compose.yml"
7272- services:
7373- komodo-import:
7474- image: foxxmd/komodo-import:latest
7575- volumes:
7676- ## ParentDirectory:FILES_ON_SERVER_DIR
7777- - /home/myUser/homelab:/filesOnServer:ro
7878- environment:
7979- - TZ=America/New_York
8080- ## Komodo Server name to use for generated Stacks
8181- - SERVER_NAME=my-cool-server
8282- ## ParentDirectory on the host use as Stack Run Directory prefix
8383- - HOST_PARENT_PATH=/home/myUser/homelab
8484- restart: no
8585- ```
8686- ```shell
8787- docker compose up --no-log-prefix
8888- ```
8989- </TabItem>
9090-</Tabs>
9191-9292-<details>
9393-9494-<summary>Output</summary>
9595-9696-```shell
9797-[2025-08-11 14:06:19.080 -0400] INFO : [Init] Debug Mode: NO
9898-[2025-08-11 14:06:19.094 -0400] INFO : [App] Version: 0.1.0
9999-[2025-08-11 14:06:19.095 -0400] INFO : [App] Files On Server Dir ENV: /filesOnServer -> Resolved: /filesOnServer
100100-[2025-08-11 14:06:19.096 -0400] INFO : [App] [Files On Server] Processing Stacks for 6 folders:
101101-/filesOnServer/compose.yaml
102102-/filesOnServer/immich
103103-/filesOnServer/jellyfin
104104-/filesOnServer/octoprint
105105-/filesOnServer/plex
106106-/filesOnServer/uptime-kuma
107107-[2025-08-11 14:06:19.096 -0400] INFO : [App] [Files On Server] Compose File Glob: **/{compose,docker-compose}*.y?(a)ml
108108-[2025-08-11 14:06:19.097 -0400] INFO : [App] [Files On Server] Env Glob: **/.env
109109-[2025-08-11 14:06:19.097 -0400] INFO : [App] [Files On Server] [compose] Found Stack 'compose' at dir /filesOnServer/compose.yaml
110110-[2025-08-11 14:06:19.103 -0400] WARN : [App] [Files On Server] [compose] Did not find any files patterns matching compose glob
111111-[2025-08-11 14:06:19.103 -0400] INFO : [App] [Files On Server] [compose] Stack config complete
112112-[2025-08-11 14:06:19.104 -0400] INFO : [App] [Files On Server] [immich] Found Stack 'immich' at dir /filesOnServer/immich
113113-[2025-08-11 14:06:19.107 -0400] INFO : [App] [Files On Server] [immich] Found 1 files matching compose glob:
114114-docker/docker-compose.yaml
115115-[2025-08-11 14:06:19.107 -0400] INFO : [App] [Files On Server] [immich] Using file(s): docker/docker-compose.yaml
116116-[2025-08-11 14:06:19.108 -0400] INFO : [App] [Files On Server] [immich] Stack config complete
117117-[2025-08-11 14:06:19.108 -0400] INFO : [App] [Files On Server] [jellyfin] Found Stack 'jellyfin' at dir /filesOnServer/jellyfin
118118-[2025-08-11 14:06:19.109 -0400] INFO : [App] [Files On Server] [jellyfin] Found 3 files matching compose glob:
119119-compose.yaml
120120-docker-compose.yaml
121121-docker/docker-compose.yaml
122122-[2025-08-11 14:06:19.110 -0400] INFO : [App] [Files On Server] [jellyfin] Using file: compose.yaml but not writing to file_paths since this is the Komodo default
123123-[2025-08-11 14:06:19.111 -0400] INFO : [App] [Files On Server] [jellyfin] Found 1 env files matching pattern **/.env:
124124-.env
125125-[2025-08-11 14:06:19.111 -0400] INFO : [App] [Files On Server] [jellyfin] Using .komodoEnv for Komodo-written env file
126126-[2025-08-11 14:06:19.111 -0400] INFO : [App] [Files On Server] [jellyfin] Stack config complete
127127-[2025-08-11 14:06:19.111 -0400] INFO : [App] [Files On Server] [octoprint] Found Stack 'octoprint' at dir /filesOnServer/octoprint
128128-[2025-08-11 14:06:19.112 -0400] WARN : [App] [Files On Server] [octoprint] Did not find any files patterns matching compose glob
129129-[2025-08-11 14:06:19.112 -0400] INFO : [App] [Files On Server] [octoprint] Stack config complete
130130-[2025-08-11 14:06:19.113 -0400] INFO : [App] [Files On Server] [plex] Found Stack 'plex' at dir /filesOnServer/plex
131131-[2025-08-11 14:06:19.114 -0400] INFO : [App] [Files On Server] [plex] Found 1 files matching compose glob:
132132-compose.yaml
133133-[2025-08-11 14:06:19.114 -0400] INFO : [App] [Files On Server] [plex] Using file: compose.yaml but not writing to file_paths since this is the Komodo default
134134-[2025-08-11 14:06:19.115 -0400] INFO : [App] [Files On Server] [plex] Stack config complete
135135-[2025-08-11 14:06:19.115 -0400] INFO : [App] [Files On Server] [uptime-kuma] Found Stack 'uptime-kuma' at dir /filesOnServer/uptime-kuma
136136-[2025-08-11 14:06:19.116 -0400] INFO : [App] [Files On Server] [uptime-kuma] Found 1 files matching compose glob:
137137-compose.yaml
138138-[2025-08-11 14:06:19.116 -0400] INFO : [App] [Files On Server] [uptime-kuma] Using file: compose.yaml but not writing to file_paths since this is the Komodo default
139139-[2025-08-11 14:06:19.117 -0400] INFO : [App] [Files On Server] [uptime-kuma] Found 1 env files matching pattern **/.env:
140140-.env
141141-[2025-08-11 14:06:19.117 -0400] INFO : [App] [Files On Server] [uptime-kuma] Using .komodoEnv for Komodo-written env file
142142-[2025-08-11 14:06:19.117 -0400] INFO : [App] [Files On Server] [uptime-kuma] Stack config complete
143143-[2025-08-11 14:06:19.118 -0400] INFO : [App] [Files On Server] Built Stack configs for 6 folders
144144-[2025-08-11 14:06:19.119 -0400] INFO : [App] Copy the text between the scissors to use as the *Resource File* contents within your Resource Sync
145145-146146-✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️
147147-[[stack]]
148148-name = "compose"
149149-150150-[stack.config]
151151-server = "my-cool-server"
152152-run_directory = "/home/myUser/homelab/compose"
153153-files_on_host = true
154154-auto_update = false
155155-poll_for_updates = false
156156-157157-[[stack]]
158158-name = "immich"
159159-160160-[stack.config]
161161-server = "my-cool-server"
162162-run_directory = "/home/myUser/homelab/immich"
163163-files_on_host = true
164164-auto_update = false
165165-poll_for_updates = false
166166-file_paths = [ "docker/docker-compose.yaml" ]
167167-168168-[[stack]]
169169-name = "jellyfin"
170170-171171-[stack.config]
172172-server = "my-cool-server"
173173-run_directory = "/home/myUser/homelab/jellyfin"
174174-files_on_host = true
175175-auto_update = false
176176-poll_for_updates = false
177177-env_file_path = ".komodoEnv"
178178-additional_env_files = [ ".env" ]
179179-180180-[[stack]]
181181-name = "octoprint"
182182-183183-[stack.config]
184184-server = "my-cool-server"
185185-run_directory = "/home/myUser/homelab/octoprint"
186186-files_on_host = true
187187-auto_update = false
188188-poll_for_updates = false
189189-190190-[[stack]]
191191-name = "plex"
192192-193193-[stack.config]
194194-server = "my-cool-server"
195195-run_directory = "/home/myUser/homelab/plex"
196196-files_on_host = true
197197-auto_update = false
198198-poll_for_updates = false
199199-200200-[[stack]]
201201-name = "uptime-kuma"
202202-203203-[stack.config]
204204-server = "my-cool-server"
205205-run_directory = "/home/myUser/homelab/uptime-kuma"
206206-files_on_host = true
207207-auto_update = false
208208-poll_for_updates = false
209209-env_file_path = ".komodoEnv"
210210-additional_env_files = [ ".env" ]
211211-✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️
212212-[2025-08-11 14:06:19.119 -0400] INFO : [App] Done!
6363+```yaml title="docker-compose.yml"
6464+services:
6565+ komodo-import:
6666+ image: foxxmd/komodo-import:latest
6767+ volumes:
6868+ - /home/myUser/homelab:/filesOnServer:ro
6969+ environment:
7070+ - TZ=America/New_York
7171+ ## Komodo Server name to use for generated Stacks
7272+ - SERVER_NAME=my-cool-server
7373+ ## ParentDirectory on the host use as Stack Run Directory prefix
7474+ - HOST_DIR=/home/myUser/homelab
7575+ ## generate stacks from mounted directory subfolders
7676+ - STACKS_FROM=dir
7777+ restart: no
21378```
21479215215-</details>
8080+<ConsoleOutput/>
2168121782## Local Installation
21883···23297#### Usage Examples
2339823499```shell
235235-SERVER_NAME=my-server HOST_PARENT_PATH=/my/parent/folder node src/index.js
100100+SERVER_NAME=my-cool-server STACKS_FROM=dir MOUNT_DIR=/my/parent/folder node src/index.js
236101```
+2-2
docsite/docs/quickstart.mdx
···34343535There are many more options (environmental variables) that can be used to customize how Stacks are generated, all found in [Usage](../usage/overview#stacks) docs. Some customizations that might interest you:
36363737-* [Common Stack options](../usage/overview#common-stack-configuration)
3737+* [Common Stack options](../usage/overview#stack-configuration)
3838 * Set image registry provider/account
3939 * Set defaults for polling for new images (`POLL_FOR_UPDATE`) and auto updating (`AUTO_UPDATE`)
4040 * Set what compose files (`COMPOSE_FILE_GLOB`) and .env files (`ENV_FILE_GLOB`) to include, per Stack
4141* For **Directory** generated stacks...
4242 * Include (`FOLDER_GLOB`) or exclude (`FOLDER_IGNORE_GLOB`) folders based on patterns
4343-* Configure Komodo Import to use the Komodo API for better integration
4343+* Configure Komodo Import to use the [Komodo API](../usage/overview#komodo-api) for better integration
4444 * Uses existing Linked Repos for Git Based Stacks
4545 * Automatically configures Git Based Stacks to use existing, private Git Provider if git URL domains match
4646
+254-164
docsite/docs/usage/overview.mdx
···88import CodeBlock from '@theme/CodeBlock';
99import AIOExample from "../../src/components/AIOExample";
1010import FileExample from "../../src/components/FileExample";
1111+import TreeDirectory from '../../src/components/snippets/_directoryTree.mdx'
1212+import TreeCompose from '../../src/components/snippets/_composeTree.mdx'
1313+import ComposeExample from '../../src/components/snippets/_composeExample.mdx'
11141215## Key Concepts
1316···3437These are where and how KI puts the Resources created from [Inputs](#inputs):
35383639* Log to output (docker logs, node console)
3737-* Log to file
3840* Export to Komodo API (create Resource Sync, etc.)
39414042## Inputs
···43454446KI can create Komodo [Stack](https://komo.do/docs/resources#stack) Resources from existing resources on your machine.
45474646-##### Common Stack Configuration
4848+It will automatically detect what type of Stack to create based on the presence of git folders/data:
4949+5050+* Komodo **Files On Server** Stack => compose project/folder without a `.git` folder
5151+* Komodo **Git Repo** Stacks => compose project/folder with a `.git` folder or with a parent folder containing a `.git` folder
5252+5353+#### Stack Sources
5454+5555+KI can generate Stacks from existing projects on your machine using one of two methods:
5656+5757+<Tabs groupId="stacksFrom" queryString>
5858+ <TabItem value="dir" label="Directory">
5959+ For **Directory** (`STACKS_FROM=dir`), Komodo Import will try to generate Stacks from each immediate **subfolder** inside the directory mounted into the container.
6060+6161+6262+ <details>
6363+6464+ <summary>Example</summary>
6565+6666+ <TreeDirectory/>
6767+6868+ Using `STACKS_FROM=dir` with [host directory](#host-directory) `/home/myUser/homelab` would produce Stacks for `immich` `plex` and `uptime-kuma`.
6969+7070+ </details>
7171+7272+ </TabItem>
7373+ <TabItem value="compose" label="Compose Projects">
7474+ For **Compose Projects** (`STACKS_FROM=compose`), Komodo Import will try to generate Stacks from existing projects on your machine that were created with `docker compose up`.
7575+7676+ <details>
7777+7878+ <summary>Example</summary>
47794848-These environmental variables are applicable to all Stack types below.
8080+ <ComposeExample/>
49815050-<details>
8282+ * Using `STACKS_FROM=dir` with [host directory](#host-directory) `/home/myUser` would produce Stacks for `immich` `plex` and `project1`.
8383+ * It **would not** generate a Stack for `owncloud` since it was not created with `docker compose up` yet.
8484+8585+ </details>
8686+8787+ To use **Compose Projects** you must give Komodo Import access to Docker. This can be done by mounting `docker.sock` into the container or connecting it to a proxy service like [docker-socket-proxy](https://github.com/Tecnativa/docker-socket-proxy).
8888+8989+ <details>
9090+9191+ <summary>Using `socket-proxy` (recommended)</summary>
9292+9393+ Add a socket-proxy service to your compose file and set the env `DOCKER_HOST` so Komodo Import knows how to connect to Docker:
9494+9595+ ```yaml title="compose.yaml"
9696+ services:
9797+ komodo-import:
9898+ # ...
9999+ environment:
100100+ # ...
101101+ # add to existing environment
102102+ - DOCKER_HOST=tcp://socket-proxy:2375
103103+ socket-proxy:
104104+ image: lscr.io/linuxserver/socket-proxy:latest
105105+ environment:
106106+ - CONTAINERS=1
107107+ - INFO=1
108108+ - POST=0
109109+ - PING=1
110110+ - VERSION=1
111111+ volumes:
112112+ - /var/run/docker.sock:/var/run/docker.sock:ro
113113+ read_only: true
114114+ tmpfs:
115115+ - /run
116116+ ```
117117+ </details>
511185252-<summary>Environmental Variables</summary>
119119+ <details>
531205454-| ENV | Required | Default | Description |
5555-| :------------------------ | :------- | -------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------- |
5656-| `SERVER_NAME` | ☑️ | | The name of the Komodo [Server](https://komo.do/docs/resources#server) where a Stack is located |
5757-| `HOST_PARENT_PATH` | ☑️ | | The parent directory on the **host** where stack folders are located. |
5858-| `WRITE_ENV` | - | `false` | Write the contents of found .env files to Komodo **Environment**. Likely want this as `true`. |
5959-| `FOLDER_GLOB` | - | `*` | The [glob](https://github.com/isaacs/node-glob?tab=readme-ov-file#glob-primer) pattern to use for finding folders in the top-level folder given to Komodo Import |
6060-| `FOLDER_IGNORE_GLOB` | - | | The [glob](https://github.com/isaacs/node-glob?tab=readme-ov-file#glob-primer) pattern to use to ignore folders in the top-level folder given to Komodo Import |
6161-| `COMPOSE_FILE_GLOB` | - | `**/{compose,docker-compose}*.y?(a)ml` | The [glob](https://github.com/isaacs/node-glob?tab=readme-ov-file#glob-primer) pattern to use for finding files for **Files Paths** in Stack config |
6262-| `ENV_FILE_GLOB` | - | `**/.env` | The [glob](https://github.com/isaacs/node-glob?tab=readme-ov-file#glob-primer) pattern to use for finding files for **Additional Env Files** in Stack config |
6363-| `KOMODO_ENV_NAME` | - | `.komodoenv` | If existing .env files are found, and `WRITE_ENV=false`, then this name will be used for the .env that Komodo writes using its own Environment section |
6464-| `IMAGE_REGISTRY_PROVIDER` | - | | Name of Image Registry to use |
6565-| `IMAGE_REGISTRY_ACCOUNT` | - | | Image Registry account to use |
6666-| `POLL_FOR_UPDATE` | - | | Poll for newer images? |
6767-| `AUTO_UPDATE` | - | | Auto Update stack? |
121121+ <summary>Mounting `docker.sock`</summary>
681226969-</details>
123123+ Mount `/var/run/docker.sock` as a volume into the container:
701247171-#### Files On Server
125125+ ```yaml title="compose.yaml"
126126+ services:
127127+ komodo-import:
128128+ # ...
129129+ volumes:
130130+ # ...
131131+ # add to existing volumes
132132+ - /var/run/docker.sock:/var/run/docker.sock:ro
133133+ ```
134134+ </details>
135135+ </TabItem>
136136+</Tabs>
721377373-Use existing, non git-based [Docker Compose projects](https://docs.docker.com/compose/how-tos/project-name/) (`compose.yaml`) as **Files On Server** mode Komodo Stacks.
138138+#### Host Directory
741397575-KI will generate multiple Stacks from all folders within the given folder. This is similar to how [dockge](https://github.com/louislam/dockge) works.
140140+The directory on the **Host** machine that should be mounted into the Komodo Import container depends on which [Stack Source](#stack-sources) you are using.
761417777-<details>
142142+* The host directory should be mounted to `/filesOnServer` in the container.
143143+* **The host directory should also be set for `HOST_DIR` env.**
781447979-<summary>Example</summary>
145145+<Tabs groupId="stacksFrom" queryString>
146146+ <TabItem value="dir" label="Directory">
147147+ For **Directory** (`STACKS_FROM=dir`) use the **parent folder** containing all of the immediate **subfolders** that should be generated as Stacks.
801488181-If your folder structure looks like this
149149+ <details>
821508383-```
8484-.
8585-└── /home/myUser/homelab/
8686- ├── immich/
8787- │ └── compose.yaml
8888- ├── plex/
8989- │ └── docker-compose.yaml
9090- └── uptime-kuma/
9191- └── compose.yaml
9292-```
151151+ <summary>Example</summary>
931529494-and you use `/home/myUser/homelab/` with KI then it will output stacks for
153153+ <TreeDirectory/>
951549696-* **immich** with Run Directory `/home/myUser/homelab/immich`
9797-* **plex** with Run Directory `/home/myUser/homelab/plex`
9898-* **uptime-kuma** with Run Directory `/home/myUser/homelab/uptime-kuma`
155155+ Directory should be `home/myUser/homelab`:
99156100100-</details>
157157+ ```yaml title="compose.yaml"
158158+ services:
159159+ komodo-import:
160160+ # ...
161161+ volumes:
162162+ - /home/myUser/homelab:/filesOnServer
163163+ environment:
164164+ - HOST_DIR=/home/myUser/homelab
165165+ ```
166166+ </details>
101167102102-###### Project Files Detection {#project-file-detection}
168168+ </TabItem>
169169+ <TabItem value="compose" label="Compose Projects">
170170+ For **Compose Projects** (`STACKS_FROM=compose`) use the closest **parent folder** that contains all discovered compose project Config Files (`docker compose ls`).
103171104104-Komodo Import makes some reasonable assumptions about which `compose.yaml` and `.env` files you want to use within each project's folder. These can be overriden using the `*_GLOB` environmental varibales from the [Configuration](#fos-config) below.
172172+ <details>
105173106106-<details>
174174+ <summary>Example</summary>
107175108108-<summary>File Detection and Behavior Details</summary>
176176+ <TreeCompose/>
109177110110-* Compose Files
111111- * Default pattern
112112- * Looks for `compose.y(a)ml` and `docker-compose.y(a)ml`
113113- * Files may have interim names like `compose.dev.yaml`
114114- * Can be overridden with `COMPOSE_FILE_GLOB` env
115115- * Will prioritize `compose.yaml` over `docker-compose.yaml`
116116- * Will choose the file with the shortest path EX
117117- * Prioritizes `./compose.yaml` over `./aFolder/compose.yaml`
118118-* .env Files
119119- * Default pattern
120120- * Adds all `.env` files found at top-level or sub-folders
121121- * Can be overridden with `ENV_FILE_GLOB` env
122122- * If a `.env` file is found then configures Komodo to write it's own Environment section to `.komodoenv` instead of `.env`
123123- * Komodo env name can be overridden with `KOMODO_ENV_NAME`
178178+ Directory should be `/home/myUser` because projects are found under both `localDev` and `homeLab`:
124179125125-Komodo Import will **log** which files it detects and indicate which ones it will use for each project. These can be manually modified in the generated TOML, [API Sync Resource](#api-sync), or after creating the Stack in Komodo.
180180+ ```yaml itle="compose.yaml"
181181+ services:
182182+ komodo-import:
183183+ # ...
184184+ volumes:
185185+ - /home/myUser:/filesOnServer
186186+ environment:
187187+ - HOST_DIR=/home/myUser
188188+ ```
189189+ </details>
190190+ </TabItem>
191191+</Tabs>
126192127127-</details>
193193+#### Stack Configuration
128194129129-##### Configuration {#fos-config}
195195+The configuration and behaviors below are applicable to all Stacks:
130196131197<details>
132198133199<summary>Environmental Variables</summary>
134200135135-Use the [**Common Stack Configuration environmental variables**](#common-stack-configuration)
201201+| ENV | Required | Default | Description |
202202+| :------------------------ | :------- | -------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------- |
203203+| `SERVER_NAME` | ☑️ | | The name of the Komodo [Server](https://komo.do/docs/resources#server) where a Stack is located |
204204+| `STACKS_FROM` | ☑️ | `dir` | What [**Stack Sources**](#stack-source) to generate Stacks from? `dir` or `compose` |
205205+| `HOST_DIR` | ☑️ | | The parent directory on the **host** that mounted into the Komodo Import container |
206206+| `WRITE_ENV` | - | `true` | Write the contents of found .env files to Komodo **Environment**. Likely want this as `true`. |
207207+| `COMPOSE_FILE_GLOB` | - | `**/{compose,docker-compose}*.y?(a)ml` | The [glob](https://github.com/isaacs/node-glob?tab=readme-ov-file#glob-primer) pattern to use for finding files for **Files Paths** in Stack config |
208208+| `ENV_FILE_GLOB` | - | `**/.env` | The [glob](https://github.com/isaacs/node-glob?tab=readme-ov-file#glob-primer) pattern to use for finding files for **Additional Env Files** in Stack config |
209209+| `KOMODO_ENV_NAME` | - | `.komodoenv` | If existing .env files are found, and `WRITE_ENV=false`, then this name will be used for the .env that Komodo writes using its own Environment section |
210210+| `IMAGE_REGISTRY_PROVIDER` | - | | Name of Image Registry to use |
211211+| `IMAGE_REGISTRY_ACCOUNT` | - | | Image Registry account to use |
212212+| `POLL_FOR_UPDATE` | - | | Poll for newer images? |
213213+| `AUTO_UPDATE` | - | | Auto Update stack? |
136214137215</details>
138216139139-For [docker](../../installation#docker) usage the folder with your projects should be mounted to `/filesOnServer` in the container.
217217+<details markdown="1">
140218141141-#### Git Repo
219219+<summary>Compose File Detection</summary>
142220143143-Use existing, **git repository** folders containing [Docker Compose projects](https://docs.docker.com/compose/how-tos/project-name/) (`compose.yaml`) as **Git Repo** mode Komodo Stacks.
221221+* Default pattern
222222+ * Looks for `compose.y(a)ml` and `docker-compose.y(a)ml`
223223+ * Files may have interim names like `compose.dev.yaml`
224224+ * Can be overridden with `COMPOSE_FILE_GLOB` env for non-compose project stack sources
225225+* Will prioritize `compose.yaml` over `docker-compose.yaml`
226226+* Will choose the file with the shortest path EX
227227+ * Prioritizes `./compose.yaml` over `./aFolder/compose.yaml`
144228145145-KI will generate multiple Stacks from all folders within the given folder. Each folder detected as a git repository will have all required fields in a Git Repo Komodo Stack configured based on information from the local repository.
229229+Komodo Import will **log** which files it detects and indicate which ones it will use for each project.
230230+231231+:::note
232232+233233+When using [Compose Projects Stack Source](./?stacksFrom=compose#stack-sources) compose files are automatically parsed from the running projects.
234234+235235+:::
236236+237237+</details>
238238+239239+<details>
240240+241241+<summary>`.env` File Detection</summary>
242242+243243+* Default pattern
244244+ * Adds all `.env` files found at top-level or sub-folders
245245+ * Can be overridden with `ENV_FILE_GLOB` env
246246+* If a `.env` file is found and `WRITE_ENV=false` then a Stack is configured to write it's own Environment section to `.komodoenv` instead of `.env`
247247+ * Komodo env name can be overridden with `KOMODO_ENV_NAME`
248248+249249+Komodo Import will **log** which files it detects and indicate which ones it will use for each project.
250250+251251+</details>
252252+253253+254254+There is additional configuration available depending on the [Stack Source](#stack-sources):
255255+256256+<Tabs groupId="stacksFrom" queryString>
257257+ <TabItem value="dir" label="Directory">
258258+259259+ * The `_GLOB` patterns are for matching folder names within the parent folder, not full directory paths
260260+ * The default pattern matches all folder names except those starting with a `.`
261261+262262+| ENV | Required | Default | Description |
263263+| :------------------- | :------- | ------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------- |
264264+| `FOLDER_GLOB` | - | `*` | The [glob](https://github.com/isaacs/node-glob?tab=readme-ov-file#glob-primer) pattern to use for finding folders in the top-level folder given to Komodo Import |
265265+| `FOLDER_IGNORE_GLOB` | - | | The [glob](https://github.com/isaacs/node-glob?tab=readme-ov-file#glob-primer) pattern to use to ignore folders in the top-level folder given to Komodo Import |
266266+267267+ </TabItem>
268268+ <TabItem value="compose" label="Compose Projects">
269269+270270+ * The `_GLOB` patterns are for matching **full directory paths**, not just a single folder name
271271+ * The default pattern matches all directories except those that have any folder starting with a `.`
272272+ * Komodo Import will **always** ignore projects created by Komodo itself (projects found in `/etc/komodo` or `/home/USER/komodo`)
273273+274274+| ENV | Required | Default | Description |
275275+| :------------------------- | :------- | ------- | :---------------------------------------------------------------------------------------------------------------------------------------------------- |
276276+| `COMPOSE_FILE_GLOB` | - | `**/**` | The [glob](https://github.com/isaacs/node-glob?tab=readme-ov-file#glob-primer) pattern to use for matching a project's **full directory** on the host |
277277+| `COMPOSE_FILE_IGNORE_GLOB` | - | | The [glob](https://github.com/isaacs/node-glob?tab=readme-ov-file#glob-primer) pattern to use to ignore a project's **full directory** on the host |
278278+279279+ </TabItem>
280280+</Tabs>
281281+282282+#### Git Based Stacks
283283+284284+If a parsed folder (or parent of it) contains a `.git` folder and it has a valid tracked branch + remote, then it will generate a **Git Repo Stack**.
146285147286<details>
148287149149-<summary>How Repository Parsing Works</summary>
288288+<summary>How Git Repository Parsing Works</summary>
150289151290* A folder is only built as a Git Repo stack if...
152152- * It contains a valid `.git` folder
291291+ * It contains a valid `.git` folder or a parent folder contains a `.git` folder
153292 * The git repo has a valid remote
154293 * The current checked out local branch is tracking a remote branch
155155- * If any of the above are not true then the folder is instead parsed as a [Files On Server](#files-on-server) Stack
156156-* Additionally, if [**Komodo API is configured**](#komodo-api) then...
157157- * If Komodo has a [Repo](https://komo.do/docs/resources#repo) Resource that matches the remote, then the Git Repo Stack uses a Linked Repo
158158- * If Komodo has a Git Provider matching the remote URL domain then that is used, along with the Git Provider user (private git is automatically detected)
294294+ * If any of the above are not true then the folder is instead parsed as a Files On Server Stack
159295160296</details>
161297···182318 └── compose.yaml
183319```
184320185185-You run Komodo Import with the `homelab` directory:
186186-187187-`docker run ... -e "HOST_PARENT_PATH=/home/myUser/homelab" -v /home/myUser/homelab:/filesOnServer foxxmd/komodo-import`
188188-189321* **immich** is created as a Git Repo Stack with
190322 * Git Provider: `git.mydomain.com`
191323 * Repo: `myUser/immich`
···196328 * Run Directory: `/home/myUser/homelab/uptime-kuma`
197329</details>
198330199199-###### Monorepos
331331+Additionally, if [**Komodo API is configured**](#komodo-api) then...
200332201201-Komodo Import can also handle **monorepos.** Mount the top-level repository folder to the usual `/filesOnServer` location and it will automatically treat sub-folders as Git Repo Stacks using the top-level repository.
333333+* If Komodo has a [Repo](https://komo.do/docs/resources#repo) Resource that matches the remote, then the Git Repo Stack uses a Linked Repo
334334+* If Komodo has a Git Provider matching the remote URL domain then that is used, along with the Git Provider user (private git is automatically detected)
202335203203-<details>
336336+###### Monorepos
204337205205-<summary>Example</summary>
338338+Komodo Import also handles **monorepos** IE one git repository with many folders containing projects. The only requirement to ensure this works is that the git repo "root" directory must be [mounted into Komodo Import.](#host-directory)
206339207207-You have a repository at `https://git.mydomain.com/myUser/homelab` and each folder in the repo is a different stack.
340340+<Tabs groupId="stacksFrom" queryString>
341341+ <TabItem value="dir" label="Directory">
208342209209-Your folder structure (on the host machine) looks like this:
343343+ For [**Directory** Stack Source](./?stacksFrom=dir#stack-sources) use the root git repository directory as the [host directory](#host-directory).
210344211211-```
212212-/home/myUser/homelab
213213-├── .git
214214-├── immich
215215-│ └── compose.yaml
216216-├── plex
217217-│ └── docker-compose.yaml
218218-└── uptime-kuma
219219- └── compose.yaml
220220-```
345345+ <details>
221346222222-You run Komodo Import with the `homelab` directory:
347347+ <summary>Example</summary>
223348224224-`docker run ... -v /home/myUser/homelab:/filesOnServer foxxmd/komodo-import`
225225-226226-* **immich** is created as a Git Repo Stack with
227227- * Git Provider: `git.mydomain.com`
228228- * Repo: `myUser/homelab`
229229- * Run Directory: `immich`
230230-* **plex** is created as a Git Repo Stack with
231231- * Git Provider: `git.mydomain.com`
232232- * Repo: `myUser/homelab`
233233- * Run Directory: `plex`
234234-* **uptime-kuma** is created as a Files On Server Stack
235235- * Git Provider: `git.mydomain.com`
236236- * Repo: `myUser/homelab`
237237- * Run Directory: `uptime-kuma`
238238-239239-</details>
240240-241241-<details>
242242-243243-<summary>Nested Monorepo</summary>
244244-245245-If your stack folders are not the immediate sub-folders in your repository then specify the _relative directory from git root_ as `GIT_STACKS_DIR` to specify what parent folder to use:
349349+ ```
350350+ /home/myUser/homelab
351351+ ├── .git
352352+ ├── immich
353353+ │ └── compose.yaml
354354+ ├── plex
355355+ │ └── docker-compose.yaml
356356+ └── uptime-kuma
357357+ └── compose.yaml
358358+ ```
246359247247-```
248248-/home/myUser/homelab
249249-├── .git
250250-├── myStacks
251251-│ ├── immich
252252-│ │ └── compose.yaml
253253-│ ├── plex
254254-│ │ └── docker-compose.yaml
255255-│ └── uptime-kuma
256256-│ └── compose.yaml
257257-└── somethingElse
258258-```
360360+ Use `/home/myUser/homelab` as the [host directory](#host-directory) because it contains `.git` folder.
259361260260-Use `GIT_STACKS_DIR=myStacks` with the above example.
362362+ </details>
261363262262-</details>
364364+ If the directory containing your projects is not the root directory then use the ENV `SCAN_DIR` to set the path to use for projects _relative_ to the [host directory](#host-directory):
263365264264-#### Configuration
366366+ <details>
265367368368+ <summary>Example</summary>
266369267267-<details>
370370+ ```
371371+ /home/myUser/homelab
372372+ ├── .git
373373+ ├── myStacks <---- parent folder containing projects
374374+ │ ├── immich
375375+ │ │ └── compose.yaml
376376+ │ ├── plex
377377+ │ │ └── docker-compose.yaml
378378+ │ └── uptime-kuma
379379+ │ └── compose.yaml
380380+ └── somethingElse
381381+ ```
268382269269-<summary>Environmental Variables</summary>
383383+ * Use `/home/myUser/homelab` as the [host directory](#host-directory) because it contains `.git` folder
384384+ * Use `SCAN_DIR=myStacks` -- the folder Komodo Import will parse projects from, _relative_ to the host directory `/home/myUser/homelab`
385385+ </details>
270386271271-Combine with [**Common Stack Configuration environmental variables**](#common-stack-configuration)
387387+ </TabItem>
388388+ <TabItem value="compose" label="Compose Projects">
272389273273-| ENV | Required | Default | Description |
274274-| :--------------- | :------- | ------- | :---------------------------------------------------------------------------- |
275275-| `GIT_STACKS_DIR` | - | | Set sub-folder to use for stacks when generating from a [monorepo](#monorepo) |
390390+ Komodo Import will automatically determine if a project is in a monorepo by scanning all parent directories for `.git` folder. Just make sure the mounted [host directory](#host-directory) contains the monorepo folder at some level.
276391277277-</details>
392392+ </TabItem>
393393+</Tabs>
278394279395## Outputs
280396···336452| `SYNC_NAME` | - | komodo-import | Name of Sync to create/modify |
337453338454</details>
339339-340340-### File
341341-342342-Komodo Import will attempt to write the generated output to a `.toml` file if the ENV `OUTPUT_DIR` is present. This should be the *directory* (not file) that the generated file should be written to.
343343-344344-Bind mount a folder into the container and set `OUTPUT_DIR` like in the example below:
345345-346346-<details>
347347-348348-<summary>File Output Example</summary>
349349-350350-```yaml
351351-services:
352352- komodo-import:
353353- # ...
354354- environment:
355355- # ...
356356- - OUTPUT_DIR=/output
357357- volumes:
358358- # ...
359359- - /my/host/folder:/output
360360-```
361361-362362-</details>
363363-364364-Use this with [manually creating Sync Resources](../resourceSync#create-sync-resource)
365455366456## Komodo API
367457
+2-2
docsite/docs/usage/resourceSync.mdx
···1818Komodo Import gives you the TOML representation of Resources not yet in Komodo. You can use this to bulk "create" Resources that connect to your existing compose projects, container, etc, by **Executing** a Sync Resource created with Komodo Import.
19192020:::tip
2121-**If you are copy-pasting [console Output](../overview#console) or [file Output](../overview#file)** then proceed to [Create Sync Resource](#create-sync-resource) to **manually** create a Sync Resource from the TOML Komodo Import generated for you.
2121+**If you are copy-pasting [console Output](../overview#console)** then proceed to [**Create Sync Resource**](#create-sync-resource) to manually create a Sync Resource from the TOML Komodo Import generated for you.
2222:::
23232424:::tip
2525-**If you used [API Output](../overview#api-sync)** then find the Sync Resource KI made for you and skip to [Verify Sync Changes](#verify-sync-changes).
2525+**If you used [API Output](../overview#api-sync)** then find the Sync Resource KI made for you and skip to [**Verify Sync Changes**](#verify-sync-changes).
2626:::
27272828### Create Sync Resource
+4-2
docsite/src/components/QuickstartCompose.tsx
···187187188188 return <Fragment>
189189190190- <h3>1. What source to generate Stacks from?</h3>
190190+ <h3>1. What <a href="../usage/overview#stack-sources">Stack Sources</a> to generate Stacks from?</h3>
191191192192 <p>
193193 <ButtonGroup
···214214 <h3>2. Where are your existing projects located on your machine?</h3>
215215216216 <p>
217217- <label className="margin-right--sm" htmlFor="hostDir"><strong>Host Directory:</strong></label>
217217+ <label className="margin-right--sm" htmlFor="hostDir"><strong><a href="../usage/overview#host-directory">Host Directory:</a></strong></label>
218218 <input id="hostDir" type="text" placeholder="/home/myUser/homelab" onChange={handleHostInputChange} value={hostInputValue}/>
219219 </p>
220220···230230 </p>
231231232232 <h3>4. Where should generated Stacks be created?</h3>
233233+234234+ <p>Choose one or more <a href="../usage/overview/#outputs-1">Outputs</a>:</p>
233235234236 <p><Button className="margin-right--md" label="Console" link="#" variant="primary" disabled/> <Button label="Komodo" link="#" variant="primary"
235237 outline={!composeState.api}