diff --git a/compose/compose.env b/compose/compose.env index db896b33c..d514f8ea5 100644 --- a/compose/compose.env +++ b/compose/compose.env @@ -15,11 +15,11 @@ COMPOSE_KOMODO_IMAGE_TAG=latest COMPOSE_LOGGING_DRIVER=local # Enable log rotation with the local driver. ## DB credentials - Ignored for Sqlite -DB_USERNAME=admin -DB_PASSWORD=admin +KOMODO_DB_USERNAME=admin +KOMODO_DB_PASSWORD=admin ## Configure a secure passkey to authenticate between Core / Periphery. -PASSKEY=a_random_passkey +KOMODO_PASSKEY=a_random_passkey #=-------------------------=# #= Komodo Core Environment =# @@ -52,8 +52,6 @@ KOMODO_MONITORING_INTERVAL="15-sec" ## Default: 5-min KOMODO_RESOURCE_POLL_INTERVAL="5-min" -## Used to auth against periphery. Alt: KOMODO_PASSKEY_FILE -KOMODO_PASSKEY=${PASSKEY} ## Used to auth incoming webhooks. Alt: KOMODO_WEBHOOK_SECRET_FILE KOMODO_WEBHOOK_SECRET=a_random_secret ## Used to generate jwt. Alt: KOMODO_JWT_SECRET_FILE @@ -115,8 +113,11 @@ KOMODO_HETZNER_TOKEN= # Alt: KOMODO_HETZNER_TOKEN_FILE ## Full variable list + descriptions are available here: ## 🦎 https://github.com/mbecker20/komodo/blob/main/config/periphery.config.toml 🦎 -## Periphery passkeys must include KOMODO_PASSKEY to authenticate -PERIPHERY_PASSKEYS=${PASSKEY} +## Periphery passkeys must include KOMODO_PASSKEY to authenticate. +PERIPHERY_PASSKEYS=${KOMODO_PASSKEY} + +## Specify the root directory used by Periphery agent. +PERIPHERY_ROOT_DIRECTORY=/etc/komodo ## Enable SSL using self signed certificates. ## Connect to Periphery at https://address:8120. diff --git a/compose/mongo.compose.yaml b/compose/mongo.compose.yaml index 2ce734f6f..4045b7962 100644 --- a/compose/mongo.compose.yaml +++ b/compose/mongo.compose.yaml @@ -43,8 +43,8 @@ services: env_file: ./compose.env environment: KOMODO_DATABASE_ADDRESS: mongo:27017 - KOMODO_DATABASE_USERNAME: ${DB_USERNAME} - KOMODO_DATABASE_PASSWORD: ${DB_PASSWORD} + KOMODO_DATABASE_USERNAME: ${KOMODO_DB_USERNAME} + KOMODO_DATABASE_PASSWORD: ${KOMODO_DB_PASSWORD} volumes: ## Core cache for repos for latest commit hash / contents - repo-cache:/repo-cache @@ -70,22 +70,21 @@ services: networks: - default env_file: ./compose.env + environment: + PERIPHERY_REPO_DIR: ${PERIPHERY_ROOT_DIRECTORY:-/etc/komodo}/repos + PERIPHERY_STACK_DIR: ${PERIPHERY_ROOT_DIRECTORY:-/etc/komodo}/stacks + PERIPHERY_SSL_KEY_FILE: ${PERIPHERY_ROOT_DIRECTORY:-/etc/komodo}/ssl/key.pem + PERIPHERY_SSL_CERT_FILE: ${PERIPHERY_ROOT_DIRECTORY:-/etc/komodo}/ssl/cert.pem volumes: ## Mount external docker socket - /var/run/docker.sock:/var/run/docker.sock ## Allow Periphery to see processes outside of container - /proc:/proc - ## use self signed certs in docker volume, - ## or mount your own signed certs. - - ssl-certs:/etc/komodo/ssl - ## manage repos in a docker volume, - ## or change it to an accessible host directory. - - repos:/etc/komodo/repos - ## manage stack files in a docker volume, - ## or change it to an accessible host directory. - - stacks:/etc/komodo/stacks - ## Optionally mount a path to store compose files - # - /path/to/compose:/host/compose + ## Specify the Periphery agent root directory. + ## Must be the same inside and outside the container, + ## or docker will get confused. See https://github.com/mbecker20/komodo/discussions/180. + ## Default: /etc/komodo. + - ${PERIPHERY_ROOT_DIRECTORY:-/etc/komodo}:${PERIPHERY_ROOT_DIRECTORY:-/etc/komodo} volumes: # Mongo @@ -93,10 +92,6 @@ volumes: mongo-config: # Core repo-cache: - # Periphery - ssl-certs: - repos: - stacks: networks: default: {} \ No newline at end of file diff --git a/compose/postgres.compose.yaml b/compose/postgres.compose.yaml index bce6e49a7..aec0dc05c 100644 --- a/compose/postgres.compose.yaml +++ b/compose/postgres.compose.yaml @@ -3,7 +3,7 @@ ################################### ## This compose file will deploy: -## 1. Postgres + FerretDB Mongo adapter +## 1. Postgres + FerretDB Mongo adapter (https://www.ferretdb.com) ## 2. Komodo Core ## 3. Komodo Periphery @@ -57,7 +57,7 @@ services: - 9120:9120 env_file: ./compose.env environment: - KOMODO_DATABASE_URI: mongodb://${DB_USERNAME}:${DB_PASSWORD}@ferretdb:27017/${KOMODO_DATABASE_DB_NAME:-komodo}?authMechanism=PLAIN + KOMODO_DATABASE_URI: mongodb://${KOMODO_DB_USERNAME}:${KOMODO_DB_PASSWORD}@ferretdb:27017/${KOMODO_DATABASE_DB_NAME:-komodo}?authMechanism=PLAIN volumes: ## Core cache for repos for latest commit hash / contents - repo-cache:/repo-cache @@ -83,32 +83,27 @@ services: networks: - default env_file: ./compose.env + environment: + PERIPHERY_REPO_DIR: ${PERIPHERY_ROOT_DIRECTORY:-/etc/komodo}/repos + PERIPHERY_STACK_DIR: ${PERIPHERY_ROOT_DIRECTORY:-/etc/komodo}/stacks + PERIPHERY_SSL_KEY_FILE: ${PERIPHERY_ROOT_DIRECTORY:-/etc/komodo}/ssl/key.pem + PERIPHERY_SSL_CERT_FILE: ${PERIPHERY_ROOT_DIRECTORY:-/etc/komodo}/ssl/cert.pem volumes: ## Mount external docker socket - /var/run/docker.sock:/var/run/docker.sock ## Allow Periphery to see processes outside of container - /proc:/proc - ## use self signed certs in docker volume, - ## or mount your own signed certs. - - ssl-certs:/etc/komodo/ssl - ## manage repos in a docker volume, - ## or change it to an accessible host directory. - - repos:/etc/komodo/repos - ## manage stack files in a docker volume, - ## or change it to an accessible host directory. - - stacks:/etc/komodo/stacks - ## Optionally mount a path to store compose files - # - /path/to/compose:/host/compose + ## Specify the Periphery agent root directory. + ## Must be the same inside and outside the container, + ## or docker will get confused. See https://github.com/mbecker20/komodo/discussions/180. + ## Default: /etc/komodo. + - ${PERIPHERY_ROOT_DIRECTORY:-/etc/komodo}:${PERIPHERY_ROOT_DIRECTORY:-/etc/komodo} volumes: # Postgres pg-data: # Core repo-cache: - # Periphery - ssl-certs: - repos: - stacks: networks: default: {} \ No newline at end of file diff --git a/compose/sqlite.compose.yaml b/compose/sqlite.compose.yaml index 6a41260e0..54739f425 100644 --- a/compose/sqlite.compose.yaml +++ b/compose/sqlite.compose.yaml @@ -3,7 +3,7 @@ ################################# ## This compose file will deploy: -## 1. Sqlite + FerretDB Mongo adapter +## 1. Sqlite + FerretDB Mongo adapter (https://www.ferretdb.com) ## 2. Komodo Core ## 3. Komodo Periphery @@ -65,32 +65,27 @@ services: networks: - default env_file: ./compose.env + environment: + PERIPHERY_REPO_DIR: ${PERIPHERY_ROOT_DIRECTORY:-/etc/komodo}/repos + PERIPHERY_STACK_DIR: ${PERIPHERY_ROOT_DIRECTORY:-/etc/komodo}/stacks + PERIPHERY_SSL_KEY_FILE: ${PERIPHERY_ROOT_DIRECTORY:-/etc/komodo}/ssl/key.pem + PERIPHERY_SSL_CERT_FILE: ${PERIPHERY_ROOT_DIRECTORY:-/etc/komodo}/ssl/cert.pem volumes: ## Mount external docker socket - /var/run/docker.sock:/var/run/docker.sock ## Allow Periphery to see processes outside of container - /proc:/proc - ## use self signed certs in docker volume, - ## or mount your own signed certs. - - ssl-certs:/etc/komodo/ssl - ## manage repos in a docker volume, - ## or change it to an accessible host directory. - - repos:/etc/komodo/repos - ## manage stack files in a docker volume, - ## or change it to an accessible host directory. - - stacks:/etc/komodo/stacks - ## Optionally mount a path to store compose files - # - /path/to/compose:/host/compose + ## Specify the Periphery agent root directory. + ## Must be the same inside and outside the container, + ## or docker will get confused. See https://github.com/mbecker20/komodo/discussions/180. + ## Default: /etc/komodo. + - ${PERIPHERY_ROOT_DIRECTORY:-/etc/komodo}:${PERIPHERY_ROOT_DIRECTORY:-/etc/komodo} volumes: # Sqlite sqlite-data: # Core repo-cache: - # Periphery - ssl-certs: - repos: - stacks: networks: default: {} \ No newline at end of file