Install P4 DAM using Docker

P4 DAM can be installed using the Docker image.

Deploying P4 DAM using Docker is a Technology Preview. Features offered in Technology Preview are experimental and not guaranteed to always work as expected. If you have feedback and functionality suggestions, email techpreview@perforce.com.

Before you begin

  • You must have a P4 Server server running (P4 Server 2024.1 or later). P4 DAM must be connected to the central server or the commit server in a commit-edge environment. One P4 license seat to give P4 DAM super level access to the P4 Server with an optional unlimited timeout ticket when ticket-based authentication is used. To learn more, see Ticket-based authentication in the P4 Admin Documentation.

  • P4 DAM must expose port 443 for https access, and be accessible through the configured HTH_URL from the P4 Server for extensions to work. In addition, port 1601 must be exposed for P4 Server and P4 DAM to communicate with P4 Search. If you do not have a valid DNS record for HTH_URL, you can use /etc/hosts to map the domain and uncomment and update extra_hosts also under backend container in docker-compose.yml.

  • The Docker Compose setup already includes P4 Search, P4 Render, and Elasticsearch with the helix-plugin-filter installed for demonstration purposes.

  • For demonstration deployments using Docker Compose, your system must include a minimum of four CPU cores and 16 GB of memory.

  • Your host system must support Docker, and the user deploying the Docker container must have permissions to access Docker. To learn more:

Advanced setup

Install P4 DAM with Docker

This Compose file is just an example to illustrate how all the components are connected.

To start P4 DAM with Docker, run the following Docker commands on your local host:

  1. Clone the GitHub repository including the Docker-Compose file and the other required files:

    git clone https://github.com/perforce/p4dam

    cd p4dam

  2. Fetch the P4 DAM Docker containers:

    docker compose pull

  3. Copy the .env.template file as .env.

    cp .env.template .env

  4. Upload a valid certificate and key under nginx/ssl/server.crt and nginx/ssl/server.key. Alternatively, for demonstration purposes, you can generate a self-signed certificate by running the following command:

    openssl req -newkey rsa:2048 -new -x509 -days 730 -nodes -out nginx/ssl/server.crt -keyout nginx/ssl/server.key -subj "/CN=localhost"

  5. Generate unique secrets for HTH_SECRET_KEY_BASE and HTH_SITE_PEPPER environment variables by running the following command twice and copying printed hex values.

    openssl rand -hex 64

  6. Generate a token for P4 Search for the HTH_P4SEARCH_TOKEN in the .env file. For example, by using uuidgen.

  7. Create a long-lived all-hosts ticket to authorize the P4 DAM integration user and set it as HTH_HELIX_PASSWORD in the .env file. Use the following command to create the long-lived all-hosts ticket:

    p4 -p <p4port> -u <p4user> login -a -p

  8. Configure the following initial setup variables for your instance in the .env file. To learn more, see Update configuration settings.

    Copy
    HTH_DB_PASSWORD
    HTH_DEFAULT_COMPANY
    HTH_HELIX_CHARSET
    HTH_HELIX_FINGERPRINT
    HTH_HELIX_P4PORT
    HTH_HELIX_PASSWORD
    HTH_HELIX_USER
    HTH_INIT_BOTNAME
    HTH_INIT_COMPANY_NAME
    HTH_INIT_PASSWORD
    HTH_INIT_USERNAME
    HTH_P4SEARCH_ES_PASSWORD
    HTH_REDIS_PASSWORD
    HTH_SECRET_KEY_BASE
    HTH_SITE_PEPPER
    HTH_URL
    MONGO_INITDB_ROOT_PASSWORD
  9. Configure P4 Search with the following command:

    docker compose run --rm --entrypoint "bash" -T p4search < p4search/dam_configure.sh

  10. Run Docker.

    docker compose up -d

  11. Run the initial backend setup for P4 DAM with the following command:

    docker compose exec backend bin/rails hth:first_time_dam_setup

  12. Verify the P4 DAM container is running using the following url. Replace <dam.example.com> with your P4 DAM hostname if modified:

    https://<dam.example.com>.com

Update configuration settings

You can configure P4 DAM by updating the .env file. For a full list of P4 DAM configurables, see P4 DAM Docker configuration reference. You can test some of your configuration settings, such as checking the status of your P4 Search instance, in the TeamHub admin UI.

Some settings are not available in the admin UI when you deploy with Docker.

Enable backup settings

  1. Revise the gobackup/gobackup.yml file.

  2. Set HTH_BACKUPS=1 in the .env file.

  3. Recreate the scheduler and workers containers by running the following command:

    docker compose up -d --force-recreate scheduler workers.

Configure user and group synchronization settings

Copy
       HTH_HELIX_SYNC_ENABLED
       HTH_HELIX_USERS_INCLUDE_REGEX
       HTH_HELIX_USERS_FROM_GROUPS_INCLUDE_REGEX
       HTH_HELIX_USERS_EXCLUDE_REGEX
       HTH_HELIX_USERS_FROM_GROUPS_EXCLUDE_REGEX
       HTH_HELIX_GROUPS_INCLUDE_REGEX
       HTH_HELIX_GROUPS_EXCLUDE_REGEX

Configure mail settings

Copy
       HTH_SMTP_ADDRESS
       HTH_SMTP_PORT
       HTH_SMTP_TLS
       HTH_SMTP_AUTHENTICATION
       HTH_SMTP_USERNAME
       HTH_SMTP_PASSWORD
       HTH_EMAIL
       HTH_SUPPORT_EMAIL
       HTH_REGISTRATIONS_EMAIL
       HTH_NOTIFICATIONS_EMAIL
       HTH_BACKUPS_EMAIL

Upgrade P4 DAM with Docker

P4 DAM can be upgraded using the Docker image.

To upgrade P4 DAM, start P4 DAM with Docker, and run the following Docker commands on your local host:

  1. Fetch the P4 DAM Docker container:

    docker compose pull

  2. Run Docker.

    docker compose up -d --force-recreate