Versions Compared

Key

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

...

Go to the SAMDistImages directory and run the following command:

Code Block
make install

Note

Version 1.1.x + JFrog

Once you pulled the images from JFrog (see: Amadis One - JFrog repository), you need to create a docker-compose file to setup the network and components as well as an environment file to set some variables.

Create a docker-compose-prod.yml file with similar information (can be updated according to your needs):

Code Block
version: '3.8'

services:
  database:
    container_name: database
    image: ${IMAGE_DEPLOYMENT_REPOSITORY}/secbkd-database:${VERSION}
    command: --default-authentication-plugin=mysql_native_password
    platform: linux/amd64
    env_file:
      - .env
    environment:
      MYSQL_ROOT_PASSWORD: ${ROOT_DATABASE_PASSWORD}
      DATABASE_IMAGE: ${DATABASE_IMAGE}
    ports:
      - ${DATABASE_PORT}:3306
    networks:
      - sambackendnet
    restart: always
  php:
    container_name: php
    image: ${IMAGE_DEPLOYMENT_REPOSITORY}/secbkd-php:${VERSION}
    depends_on:
      - database
    restart: unless-stopped
    volumes:
      - php_socket:/var/run/php
    env_file:
      - .env
    healthcheck:
      interval: 10s
      timeout: 3s
      retries: 3
      start_period: 30s
    networks:
      - sambackendnet

  http:
    container_name: http
    image: ${IMAGE_DEPLOYMENT_REPOSITORY}/secbkd-http:${VERSION}
    depends_on:
      - php
    environment:
      SERVER_NAME: ${SERVER_NAME:-localhost, caddy:80}
    restart: unless-stopped
    volumes:
      - php_socket:/var/run/php
    ports:
      # HTTP
      - target: 80
        published: 80
        protocol: tcp
      # HTTPS 443
      - target: 443
        published: ${API_PORT}
        protocol: tcp

networks:
  sambackendnet:
    external: true

volumes:
  php_socket:

Then create a .env file with the following data (can be updated according to your system):

Code Block
# Version of the SAM backend
VERSION=1.1.4-rc1
SERVER_NAME=dev.amadis.com

# Docker repository
IMAGE_DEPLOYMENT_REPOSITORY=amadis.jfrog.io/aone-secbkd-local

# Permanent storage base directory
STORAGE_BASE_DIRECTORY=./Storage

# Database server address
DATABASE_SERVER=database

# Database server address
DATABASE_PORT=3306

# MUST be sambackend as set in the distribution images
DATABASE_NAME=sambackend

# Database username to use
DATABASE_USER=sambackend

# Database user's password to use
DATABASE_PASSWORD=sambackendpw

# Database root's password for database updates
ROOT_DATABASE_PASSWORD=tryphon1

# arm64v8/mysql:oracle or mysql:8.0-debian
DATABASE_IMAGE=mysql:8.0-debian

# Port the server will listen to.
API_PORT=443

Then create the network (if not already existing):

Code Block
docker network create sambackendnet

And start the images:

Code Block
docker-compose -f docker-compose-prod.yml up --build -d http

Additionally, it might be required to run a few more steps within the php container (docker exec -it php /bin/sh):

Code Block
php artisan db:seed (if the databse needs to be seeded with Amadis defaults)
php artisan passport:keys (macos only?)

KeyEmbeddingTool

To export the device transport key securely, the server will leverage a tool from Zimperium called KeyEmbeddingTool. That tools comes in two flavors: development and production.

...