Docker by downloading images from file

Preparation

Server Preparation:

  • Update the existing Ubuntu package list. Command: sudo apt update

  • Install Docker.

  • Install Docker Compose (version higher than 1.29).

  • Configure permissions for Docker Compose. Example of a command: sudo chmod +x /usr/local/bin/docker-compose

Distribution:

  • Get and download Docker images with the Universe product distribution in advance.

Installation

  1. Download and unpack the Docker image archives from the distribution archive. Example: universe_mdm_ee_backend_docker_v6.10.zip и universe_mdm_ee_frontend_docker_v6.10.zip. It contains Docker images with the .tar extension.

  2. Unpack the contents of the above archives to the server.

  3. Launch Docker.

  4. Start downloading images:

docker load < /opt/universe_mdm_ee_backend_docker_v6.10.tar
docker load < /opt/universe_mdm_ee_frontend_docker_v6.10.tar
  1. Wait for the completion.

  2. Create configuration files docker-compose.yml, .env. For the contents of the files, see below.

  • The location of files on the server can be any. Configuration files should be read via Docker compose.

  1. Specify the image name and tag for the .env file. Use one of the ways:

  • Change the name and tag in the parameters BACKEND_IMAGE и FRONTEND_IMAGE файла .env. Save the changes.

  • Use the command. Example:

docker image tag repo.tddev.ru/unidata-mdm/backend:v6.10 universe_mdm_ee_backend:v6.10
  1. Edit the remaining required parameters in the files docker-compose.yml, .env. Save the changes.

  2. Go to the directory with the code. Example of a command:

cd universe-mdm-deploy
  1. To start the system, use the command:

docker-compose up -d
  1. When launching the interface, the system will require a license. Install your license.

By default, the user interface is available for viewing on localhost:8082.

Default username and password: admin/admin. After the first login, you need to change your password.

Required configuration files

The files listed below must be created manually.

Example file .env:

BACKEND_IMAGE=universe_mdm_ee_backend:v6.10
FRONTEND_IMAGE=universe_mdm_ee_frontend:v6.10

OPENSEARCH_HTTP_OUTER_PORT=19201

MDM_POSTGRES_USER=postgres
MDM_POSTGRES_PASSWORD=postgres
MDM_POSTGRES_DB_NAME=postgres
POSTGRES_OUTER_PORT=15431

FRONTEND_PORT=8082
BACKEND_PORT=9081

GUEST_MODE=false

RESTORE_EMAIL_ENABLED=false
RESTORE_EMAIL_SERVER_HOST=localhost
RESTORE_EMAIL_SERVER_PORT=5025
RESTORE_EMAIL_USERNAME=universe@example.com
RESTORE_EMAIL_PASSWORD=password
RESTORE_EMAIL_FRONTEND_URL=''
RESTORE_EMAIL_SSL_ENABLE=true
RESTORE_EMAIL_STARTTLS_ENABLE=false

#nginx.conf
BACKEND_ADDRESS=http://mdm:8080
CLIENT_MAX_BODY_SIZE=100m
PROXY_SEND_TIMEOUT=600s
PROXY_READ_TIMEOUT=600s
SEND_TIMEOUT=600s

Where BACKEND_IMAGE and FRONTEND_IMAGE: names Docker-images and version tags. The tag is specified after the colon. Example values:

  • BACKEND_IMAGE=universe_mdm_ee_backend:v6.10

  • FRONTEND_IMAGE=universe_mdm_ee_frontend:v6.10

Example file docker-compose.yml:

version: '2.4'
services:
  jacoco:
    image: docker.universe-data.ru/universe/jacoco-agent:latest
    profiles: ["jacoco"]
    volumes:
      - jacoco:/jacoco:ro

  setup_json:
    image: stedolan/jq:latest
    entrypoint: >
      sh -c "
      cd /opt/json_configs;
      [ ! -z ${OVERRIDE_JSON:-''} ] &&
      jq -s '.[0] * .[1]' customer.json ${OVERRIDE_JSON}
      > ../customer.json ||
      cp customer.json ../customer.json"
    volumes:
      - ./:/opt

  ui:
    image: ${FRONTEND_IMAGE}
    restart: always
    ports:
      - ${FRONTEND_PORT}:80
    networks:
      - mdm_network
    links:
      - mdm
    volumes:
      - ${FRONTEND_UE:-/dev/null}:/usr/share/nginx/html/CUX
      - ./customer.json:/usr/share/nginx/html/customer.json
    environment:
      BACKEND_ADDRESS: ${BACKEND_ADDRESS}
      CLIENT_MAX_BODY_SIZE: ${CLIENT_MAX_BODY_SIZE}
      PROXY_SEND_TIMEOUT: ${PROXY_SEND_TIMEOUT}
      PROXY_READ_TIMEOUT: ${PROXY_READ_TIMEOUT}
      SEND_TIMEOUT: ${SEND_TIMEOUT}
    depends_on:
      setup_json:
        condition: service_completed_successfully

  mdm:
    image: ${BACKEND_IMAGE}
    restart: always
    ports:
      - ${BACKEND_PORT}:8080
      - ${JACOCO_AGENT_PORT:-6300}:6300
    networks:
      - mdm_network
    environment:
      GUEST_MODE: ${GUEST_MODE}
      POSTGRES_ADDRESS: postgres-mdm:5432
      POSTGRES_USERNAME: ${MDM_POSTGRES_USER}
      POSTGRES_PASSWORD: ${MDM_POSTGRES_PASSWORD}
      DATABASE_NAME: ${MDM_POSTGRES_DB_NAME}
      SEARCH_CLUSTER_ADDRESS: opensearch-mdm:9200
      SEARCH_CLUSTER_NAME: docker-cluster
      EMAIL_ENABLED: ${RESTORE_EMAIL_ENABLED}
      EMAIL_SERVER_HOST: ${RESTORE_EMAIL_SERVER_HOST}
      EMAIL_SERVER_PORT: ${RESTORE_EMAIL_SERVER_PORT}
      EMAIL_USERNAME: ${RESTORE_EMAIL_USERNAME}
      EMAIL_PASSWORD: ${RESTORE_EMAIL_PASSWORD}
      EMAIL_FRONTEND_URL: ${RESTORE_EMAIL_FRONTEND_URL}
      EMAIL_SSL_ENABLE: ${RESTORE_EMAIL_SSL_ENABLE}
      EMAIL_STARTTLS_ENABLE: ${RESTORE_EMAIL_STARTTLS_ENABLE}
      JAVA_TOOL_OPTIONS: ${JAVA_TOOL_OPTIONS:-}
    volumes:
      - jacoco:/jacoco:ro
    depends_on:
      postgres-mdm:
        condition: service_healthy
      opensearch-mdm:
        condition: service_healthy

  postgres-mdm:
    image: postgres:12
    restart: always
    environment:
      POSTGRES_DB: ${MDM_POSTGRES_DB_NAME}
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
      MDM_POSTGRES_USER: ${MDM_POSTGRES_USER}
      MDM_POSTGRES_PASSWORD: ${MDM_POSTGRES_PASSWORD}
    ports:
      - ${POSTGRES_OUTER_PORT}:5432
    networks:
      - mdm_network
    volumes:
      - ./init-db.sh:/docker-entrypoint-initdb.d/initdb.sh
      - mdm-postgres-data:/var/lib/postgresql/data
    command: postgres -c max_prepared_transactions=300
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres -d $MDM_POSTGRES_DB_NAME"]
      interval: 10s
      timeout: 1s
      retries: 20

  opensearch-mdm:
    image: opensearchproject/opensearch:2.7.0
    restart: always
    environment:
      - "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m"
      - "discovery.type=single-node"
      - "DISABLE_SECURITY_PLUGIN=true"
    volumes:
      - mdm-opensearch-data:/usr/share/opensearch/data
      - ./hunspell:/usr/share/opensearch/config/hunspell/
    ulimits:
      memlock:
        soft: -1
        hard: -1
    ports:
      - ${OPENSEARCH_HTTP_OUTER_PORT}:9200
    networks:
      - mdm_network
    healthcheck:
      test: >
        bash -c "curl http://localhost:9200 | grep '\"cluster_name\"'"
      interval: 10s
      timeout: 2s
      retries: 20

volumes:
  mdm-postgres-data:
    driver: local
  mdm-opensearch-data:
    driver: local
  jacoco:
    driver: local

networks:
  mdm_network:
    driver: bridge