Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Create a directory to store database state:

    Code Block
    mkdir -p var/lib/postgresql/data


  2. Create a directory to hold a database initialization script:

    Code Block
    mkdir docker-entrypoint-initdb.d


  3. 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


  4. 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"


  5. Start the containers:

    Code Block
    docker compose up -d


  6. Wait for the images to be pulled and the containers to start.
  7. You may monitor the container log output using

    Code Block
    docker compose logs


  8. Browse to https://localhost/registry/
  9. Click through the warning from your web browser about self-signed HTTPS certificates.
  10. Click LOGIN and login using the Username "registry.admin" and password "password".
  11. To stop the containers:

    Code Block
    docker compose down