COmanage Registry PE container image
2.5K
This repository provides a containerized setup for running COmanage Registry with Apache, PHP-FPM, and supporting configuration for TLS and Shibboleth SP integration.
Example environment section:
services:
comanage-registry:
environment:
# Role
- COMANAGE_ROLE=web
# General
- COMANAGE_DEBUG=1
- COMANAGE_REGISTRY_CONTAINER=1
- ENV=dev
- USERTOKEN=team-x
# URL/Apache
- COMANAGE_REGISTRY_URL_PATH=registry-pe
- COMANAGE_REGISTRY_VIRTUAL_HOST_FQDN=registry.example.org
- HTTPS_CERT_FILE=/run/secrets/https_cert_file
- HTTPS_PRIVKEY_FILE=/run/secrets/https_privkey_file
# Admin bootstrap
- COMANAGE_REGISTRY_ADMIN_GIVEN_NAME=Registry
- COMANAGE_REGISTRY_ADMIN_FAMILY_NAME=Admin
- COMANAGE_REGISTRY_ADMIN_USERNAME=registry.admin
- COMANAGE_REGISTRY_SECURITY_SALT_FILE=/run/secrets/security_salt
# Database
- COMANAGE_REGISTRY_DATABASE_DRIVER=Cake\Database\Driver\Postgres
- COMANAGE_REGISTRY_DATABASE_HOST=database
- COMANAGE_REGISTRY_DATABASE=registry
- COMANAGE_REGISTRY_DATABASE_USER=registry_user
- COMANAGE_REGISTRY_DATABASE_USER_PASSWORD_FILE=/run/secrets/db_password
- COMANAGE_REGISTRY_DATABASE_PORT=5432
- COMANAGE_REGISTRY_DATABASE_PERSISTENT=false
# Authentication (Optional: defaults to shibboleth)
# - COMANAGE_REGISTRY_AUTH_TYPE=basic
# - COMANAGE_REGISTRY_BASIC_AUTH_PASSWORDS_FILE=/run/secrets/basic_auth_passwords
# - COMANAGE_REGISTRY_ADMIN_PASSWORD=password
# Email
- COMANAGE_REGISTRY_EMAIL_TRANSPORT=Smtp
- COMANAGE_REGISTRY_EMAIL_HOST=smtp.example.org
- COMANAGE_REGISTRY_EMAIL_PORT=587
- COMANAGE_REGISTRY_EMAIL_TLS=true
- [email protected]
- COMANAGE_REGISTRY_EMAIL_ACCOUNT_PASSWORD_FILE=/run/secrets/email_password
- [email protected]
- COMANAGE_REGISTRY_EMAIL_FROM_NAME=COmanage Registry
For local development and testing, you can use HTTP Basic Authentication instead of Shibboleth.
COMANAGE_REGISTRY_AUTH_TYPE=basic in your environment.htpasswd (e.g., in the secrets/ directory):
mkdir -p secrets
htpasswd -c ./secrets/passwords admin
COMANAGE_REGISTRY_ADMIN_USERNAME and password COMANAGE_REGISTRY_ADMIN_PASSWORD (defaults to "password").docker-compose.yml secrets section and map it to the service:
services:
comanage-registry:
environment:
- COMANAGE_REGISTRY_AUTH_TYPE=basic
- COMANAGE_REGISTRY_BASIC_AUTH_PASSWORDS_FILE=/run/secrets/basic_auth_passwords
secrets:
- basic_auth_passwords
secrets:
basic_auth_passwords:
file: ./secrets/passwords
/auth/login (e.g., https://registry.example.org/registry-pe/auth/login). The default configuration for local development requires the user specified by COMANAGE_REGISTRY_ADMIN_USERNAME (default: registry.admin).COmanage Registry requires an initial setup to bootstrap the database and create the first administrator account.
The container automatically runs the setup command (bin/cake setup) on the first start if it detects that the database has not been initialized. It uses the following environment variables:
COMANAGE_REGISTRY_ADMIN_GIVEN_NAME (Default: Registry)COMANAGE_REGISTRY_ADMIN_FAMILY_NAME (Default: Admin)COMANAGE_REGISTRY_ADMIN_USERNAME (Default: registry.admin)To skip the automated setup (e.g., when connecting to an existing database), set COMANAGE_REGISTRY_SKIP_SETUP=1.
If you need to run the setup command manually (e.g., to re-run or use different parameters), use docker compose exec:
docker compose exec comanage-registry /srv/comanage-registry/app/bin/cake setup \
--admin-given-name "Admin" \
--admin-family-name "User" \
--admin-username "admin"
The setup uses environment variables for both the Docker Compose orchestration (interpolation) and the container runtime.
Automatic .env File: Docker Compose automatically loads a file named .env in the project root. This file is used to resolve placeholders like ${VARIABLE} in the docker-compose.yml.
KEY=VALUE format (no export keyword).Custom Environment Files: To use a different environment file (e.g., dev.env), you must use the --env-file flag before the subcommand (like up or build).
docker compose up --env-file dev.envdocker compose --env-file dev.env updocker compose --env-file dev.env up comanage-registry-basicdocker compose --env-file dev.env up --build comanage-registry-basicPlacement is important: The flag must come before the subcommand for it to affect the interpolation of the docker-compose.yml file.
Note on Priority: If a variable is already exported in your host shell, it will override the value in your environment file. If you see unexpected values in your container, run unset $(env | grep COMANAGE_REGISTRY_PE | cut -d= -f1) in your terminal first.
Container Runtime (env_file): The docker-compose.yml is configured to also load .env directly into the container's environment. This allows you to add variables to the container without explicitly mapping them in the environment: section.
URL Path (routing and on-disk symlink):
Logging (stdout/stderr vs file logs):
Full list of environment variables:
The container supports three logging modes. Choose based on how you want to consume logs (files vs container stdout/stderr).
Notes:
This image supports two runtime roles, selected via the COMANAGE_ROLE environment variable.
Web (default)
Cron
Example docker-compose snippet:
services:
comanage-cron:
image: i2incommon/comanage-registry:latest
environment:
# Role
- COMANAGE_ROLE=cron
# General
- COMANAGE_DEBUG=1
- COMANAGE_REGISTRY_CONTAINER=1
# Optional: override crontab path or cron user
# - COMANAGE_REGISTRY_CRONTAB=/srv/comanage-registry/local/crontab
# - COMANAGE_REGISTRY_CRON_USER=apache
# Database (should match the web service)
- COMANAGE_REGISTRY_DATABASE_DRIVER=Cake\Database\Driver\Postgres
- COMANAGE_REGISTRY_DATABASE_HOST=database
- COMANAGE_REGISTRY_DATABASE=registry
- COMANAGE_REGISTRY_DATABASE_USER=registry_user
- COMANAGE_REGISTRY_DATABASE_USER_PASSWORD_FILE=/run/secrets/db_password
- COMANAGE_REGISTRY_DATABASE_PORT=5432
- COMANAGE_REGISTRY_DATABASE_PERSISTENT=false
# Email (same config as web, so cron jobs can send mail)
- COMANAGE_REGISTRY_EMAIL_TRANSPORT=Smtp
- COMANAGE_REGISTRY_EMAIL_HOST=smtp.example.org
- COMANAGE_REGISTRY_EMAIL_PORT=587
- COMANAGE_REGISTRY_EMAIL_TLS=true
- [email protected]
- COMANAGE_REGISTRY_EMAIL_ACCOUNT_PASSWORD_FILE=/run/secrets/email_password
- [email protected]
- COMANAGE_REGISTRY_EMAIL_FROM_NAME=COmanage Registry
See LICENSE for details.
Content type
Image
Digest
sha256:49a3c11c1…
Size
604.3 MB
Last updated
about 1 month ago
docker pull i2incommon/comanage-registry-pe