Files
docker/komodo/docker-compose.yml
Chris King 8a2240a43e Finish Komodo setup
Add OIDC snippet to Caddyfile
Add komodo to Caddyfile
2025-02-18 01:12:53 -08:00

115 lines
3.6 KiB
YAML

################################
# 🦎 KOMODO COMPOSE - MONGO 🦎 #
################################
## This compose file will deploy:
## 1. MongoDB
## 2. Komodo Core
## 3. Komodo Periphery
name: komodo
services:
db:
image: mongo
labels:
komodo.skip: # Prevent Komodo from stopping with StopAllContainers
command: --quiet --wiredTigerCacheSizeGB 0.25
restart: unless-stopped
logging:
driver: ${COMPOSE_LOGGING_DRIVER:-local}
networks:
- default
# ports:
# - 27017:27017
volumes:
- ./data/mongo-data:/data/db
- ./config/mongo-config:/data/configdb
environment:
MONGO_INITDB_ROOT_USERNAME: ${KOMODO_DB_USERNAME}
MONGO_INITDB_ROOT_PASSWORD_FILE: ${KOMODO_DB_PASSWORD_FILE}
secrets:
- KOMODO_DB_PASSWORD
app:
image: ghcr.io/mbecker20/komodo:${COMPOSE_KOMODO_IMAGE_TAG:-latest}
labels:
komodo.skip: # Prevent Komodo from stopping with StopAllContainers
restart: unless-stopped
depends_on:
- db
logging:
driver: ${COMPOSE_LOGGING_DRIVER:-local}
networks:
- default
- proxy-net
ports:
- 9120:9120
env_file: ./.env
environment:
KOMODO_DATABASE_ADDRESS: db:27017
KOMODO_DATABASE_USERNAME: ${KOMODO_DB_USERNAME}
KOMODO_DATABASE_PASSWORD_FILE: ${KOMODO_DB_PASSWORD_FILE}
KOMODO_LOGGING_LEVEL: info
volumes:
## Core cache for repos for latest commit hash / contents
- ./data/repo-cache:/repo-cache
## Store sync files on server
- ./data/syncs:/syncs
## Optionally mount a custom core.config.toml
# - /path/to/core.config.toml:/config/config.toml
secrets:
- KOMODO_DB_PASSWORD
- KOMODO_PASSKEY
- KOMODO_WEBHOOK_SECRET
- KOMODO_JWT_SECRET
- KOMODO_OIDC_CLIENT_SECRET
- KOMODO_OIDC_CLIENT_ID
## Deploy Periphery container using this block,
## or deploy the Periphery binary with systemd using
## https://github.com/mbecker20/komodo/tree/main/scripts
periphery:
image: ghcr.io/mbecker20/periphery:${COMPOSE_KOMODO_IMAGE_TAG:-latest}
labels:
komodo.skip: # Prevent Komodo from stopping with StopAllContainers
restart: unless-stopped
logging:
driver: ${COMPOSE_LOGGING_DRIVER:-local}
networks:
- default
env_file: ./.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
## 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}
secrets:
- KOMODO_PASSKEY
networks:
default: {}
proxy-net:
external: true
secrets:
KOMODO_DB_PASSWORD:
file: ./secrets/KOMODO_DB_PASSWORD
KOMODO_PASSKEY:
file: ./secrets/KOMODO_PASSKEY
KOMODO_WEBHOOK_SECRET:
file: ./secrets/KOMODO_WEBHOOK_SECRET
KOMODO_JWT_SECRET:
file: ./secrets/KOMODO_JWT_SECRET
KOMODO_OIDC_CLIENT_SECRET:
file: ./secrets/KOMODO_OIDC_CLIENT_SECRET
KOMODO_OIDC_CLIENT_ID:
file: ./secrets/KOMODO_OIDC_CLIENT_ID