...
Create a directory to store database state:
Code Block mkdir -p var/lib/postgresql/data
Create a directory to hold a database initialization script:
Code Block mkdir docker-entrypoint-initdb.d
Create the database initialization script file init-user-db.sh in the directory you just created with contents
Code Block #!/bin/bash set -e psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL CREATE USER registry_user PASSWORD '${COMANAGE_REGISTRY_DATABASE_USER_PASSWORD}'; CREATE DATABASE registry; GRANT ALL PRIVILEGES ON DATABASE registry TO registry_user; EOSQL
Create the Compose YAML file docker-compose.yml with contents
Code Block services: comanage-registry-database: image: postgres:14 volumes: - ${PWD}/var/lib/postgresql/data:/var/lib/postgresql/data - ${PWD}/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d environment: - POSTGRES_PASSWORD=password - COMANAGE_REGISTRY_DATABASE_USER_PASSWORD=password comanage-registry: image: comanageproject/comanage-registry:4.1.12-basic-auth-1 environment: - COMANAGE_REGISTRY_VIRTUAL_HOST_FQDN=localhost ports: - "80:80" - "443:443"
Start the containers:
Code Block docker compose up -d
- Wait for the images to be pulled and the containers to start.
You may monitor the container log output using
Code Block docker compose logs
- Browse to https://localhost/registry/
- Click through the warning from your web browser about self-signed HTTPS certificates.
- Click LOGIN and login using the Username "registry.admin" and password "password".
To stop the containers:
Code Block docker compose down