Versions Compared

Key

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

Table of contents

...

RedHat/Fedora/CentOS

Code Block
sudo dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
sudo dnf install -y docker-ce docker-ce-cli containerd.io gnupg2 make
sudo systemctl enable --now docker

Note

The “sudo” command will require your current user to be part of the sudoers group. If not already, edit the /etc/sudoers file and add it to it.

To be able to execute some Docker commands, the current user will need to be added to the Docker group. To do so, open file /etc/group and append the current username to the “docker” line:

Code Block
docker:x:<groupid>:<username>

Note

<groupid> is already filled with a system defined value, do not edit it. Simple add your own <username> to the end of the line.

Deliverables

The backend server comes as an archive which should contain at list 2 directories:

...

The first file to look into is SAMDistImages/Configuration.conf. Make sure IMAGE_SOURCE_REPOSITORY points to “localhost” and to a directory of your choice. For example:

Code Block
IMAGE_SOURCE_REPOSITORY=localhost:5000/sambackend/distimages

Note

If you started Docker on a different port than 5000 (see Local Docker repository paragraph) then you will need to change the port number targeted in IMAGE_SOURCE_REPOSITORY.

  1. Retrieve the Dockers/SAMDeployment directory from the development project located at svn://svn.agnos.ca:3890/abc/Products/SamBackEnd/trunk into the environment where it will be installed.

  2. make the SAMDeployment directory current.

  3. Edit the Configuration.conf file. Set the parameters accordingly to your environment.

  4. Replace the certificate (fullchain.pem) and the private key (privkey.pem) in the Server/resources directory with your own.

  5. You must replace the APP_KEY in the Server/templates/laravel_env file. You can generate a new one using the following command:

    Code Block
    echo "base64:`dd if=/dev/random bs=32 count=1 | base64`"

    You can also generate a new one from the /var/www/html directory in the SAM backend container by running the command

    Code Block
    php artisan key:generate
  6. docker login dev.atheos.ca:5000

  7. Initialize the permanent storage

    Code Block
    make initstorage
  8. Initialize the database

  9. Code Block
    make initdatabase
  10. Create the images

    Code Block
    make images 
  11. Launch the SAM backend by issuing the following command.

    Code Block
    make run
  12. Optionally, install phpmyadmin for debugging purposes. It is not recommended. Customize the files fullchain.pem, passwd and privkey.pem in the resources directory. passwd is created with htpasswd. It contains the Apache2 passwords. Launch it by issuing the following commands:

    Code Block
    cd PhpMyAdmin 
    make images
    make run

...

  1. Preserve the file Configuration.conf from the previous SAMDeployment package.

  2. Preserve APP_KEY value from the .env file in the Server Docker. If needed, update SAMDeployment/Server/templates/laravel_env. The value of APP_KEY must be preserved. If lost, you SAM backend environment will have many issues.

  3. Stop the containers samserver_xx.yy.zz, samphpmyadmin_xx.yy.zz and samdatabase_xx.yy.zz

  4. Make a backup of your storage structure set using the Configuration.conf variable STORAGE_BASE_DIRECTORY

  5. Make sure you use the latest version of SAMDeployment

  6. Bump up the version number in the Configuration.conf file

  7. Update Configuration.conf matching the corresponding parameters from your previous one.

  8. Fill in any new configuration parameters.

  9. run make images

  10. run make run

  11. The container databaseupdate has a very short life span. It terminates as soon as the database is updated.