Docker Installation: Difference between revisions

From Lingoport Wiki
Jump to navigation Jump to search
 
(23 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= Work in Progress =
= Work in Progress =


This installation is for a future release.
<div style="text-align: center;"><span style="color:#FFFFFF;background:#008000"> THIS IS WORK IN PROGRESS FOR A FUTURE RELEASE </span> </div>


== General Installation Page ==
== General Installation Page ==
Line 12: Line 12:


=== Prereq ===
=== Prereq ===
* Make sure you have MySQL installed on disk
* Make sure you have the logs and config locations setup, for example:
* Make sure you have the logs and config locations setup, for example:
     centos > pwd
     centos > pwd
Line 26: Line 25:
     total 4
     total 4
     -rw-rw-r--. 1 centos centos 1445 Jun 16 21:39 LocalyzerQAConfig.groovy
     -rw-rw-r--. 1 centos centos 1445 Jun 16 21:39 LocalyzerQAConfig.groovy
You need to set
    String dbuser = 'root'
    String dbpass = 'my-secret-pw'
    grails.serverURL = 'http://cet11.lingoport.io/localyzerqa'
    String dbname = "lreviewer"
    url="jdbc:mysql://mysqlserver:3306/" + dbname + "?autoReconnect=true&useUnicode=yes&permitMysqlScheme"


* Check the local images  
* Check the local images  
Line 31: Line 39:


You may have previous LocalyzerQA images. You may want to remove them.
You may have previous LocalyzerQA images. You may want to remove them.
=== Create a network  ===
for the communication between the Web app container and MySQL Container, a network is created. It will be used when deploying the LocalyzerQA container to talk to MySQL:
  docker network create mysqlnet
  docker network list
=== Run a mysql container===
Use the network when running the LocalyzerQA container:
  docker run --network-alias mysqlserver --network mysqlnet  -e MYSQL_ROOT_PASSWORD=my-secret-pw -e MYSQL_DATABASE=lreviewer mysql:5.7
* <code>mysqlnet</code>: The network set up in the step above
* <code>mysqlserver</code>: Make sure it matches that in LocalyzerQAConfig.groovy
* <code>my-secret-pw</code>: Make sure it matches that in LocalyzerQAConfig.groovy
* <code>lreviewer</code>: The database used in MySQL for LocalyzerQA.
=== Run the LocalyzerQA Tomcat Application Container ===
  docker run -dp 8085:8080 --network mysqlnet -v "/home/centos/localyzerqa/log":/usr/local/tomcat/log -v "/home/centos/localyzerqa/logs":/usr/local/tomcat/logs -v "/home/centos/localyzerqa/config":/usr/local/tomcat/lingoport ljilingoport/localyzerqadev
    docker ps
= Use mysql on disk =
<div style="text-align: center;">
<span style="color:#FFFFFF;background:#008000"> This section and below may not be the best solution going forward. This is for reference only at this stage. </span>
</div>


=== Open port 8085 ===
=== Open port 8085 ===
    Login to AWS EC2
Login to AWS EC2
    Edit Security Group to add TCP 8085 wide open
Edit Security Group to add Dockerdev group


=== Allow access database remotely ===
=== Allow access database remotely ===
Line 40: Line 72:
   grant all privileges on *.* to root@'%' identified by 'ROOT_PASSWORD';
   grant all privileges on *.* to root@'%' identified by 'ROOT_PASSWORD';
   flush privileges;
   flush privileges;
  vi /etc/my.cnf
Add/Modify
  bind-address = 0.0.0.0
  sudo systemctl restart mysqld


=== Run the container ===
=== Run the container ===
     docker run -dp 8085:8080 -v "/home/centos/localyzerqa/log":/usr/local/tomcat/log -v "/home/centos/localyzerqa/logs":/usr/local/tomcat/logs -v "/home/centos/localyzerqa/config":/usr/local/tomcat/lingoport ljilingoport/localyzerqadev
     docker run -dp 8085:8080 -v "/home/centos/localyzerqa/log":/usr/local/tomcat/log -v "/home/centos/localyzerqa/logs":/usr/local/tomcat/logs -v "/home/centos/localyzerqa/config":/usr/local/tomcat/lingoport ljilingoport/localyzerqadev
     docker ps
     docker ps

Latest revision as of 17:38, 21 June 2022

Work in Progress

THIS IS WORK IN PROGRESS FOR A FUTURE RELEASE

General Installation Page

https://docs.docker.com/engine/install/

Centos Docker Installation

See: https://docs.docker.com/engine/install/centos/

LocalyzerQA Docker Installation

Prereq

  • Make sure you have the logs and config locations setup, for example:
   centos > pwd
   /home/centos/localyzerqa
   centos > ls -l
   total 0
   drwxrwxr-x. 2 centos centos 6 Jun 16 21:32 config
   drwxrwxr-x. 2 centos centos 6 Jun 16 21:32 log
   drwxrwxr-x. 2 centos centos 6 Jun 16 21:32 logs
  • Make sure you have the configuration file for the application (from Lingoport)
   centos > ls -l localyzerqa/config/
   total 4
   -rw-rw-r--. 1 centos centos 1445 Jun 16 21:39 LocalyzerQAConfig.groovy

You need to set

   String dbuser = 'root'
   String dbpass = 'my-secret-pw'
   grails.serverURL = 'http://cet11.lingoport.io/localyzerqa'
   String dbname = "lreviewer"
   url="jdbc:mysql://mysqlserver:3306/" + dbname + "?autoReconnect=true&useUnicode=yes&permitMysqlScheme"


  • Check the local images
   docker ps

You may have previous LocalyzerQA images. You may want to remove them.

Create a network

for the communication between the Web app container and MySQL Container, a network is created. It will be used when deploying the LocalyzerQA container to talk to MySQL:

  docker network create mysqlnet
  docker network list

Run a mysql container

Use the network when running the LocalyzerQA container:

  docker run --network-alias mysqlserver --network mysqlnet  -e MYSQL_ROOT_PASSWORD=my-secret-pw -e MYSQL_DATABASE=lreviewer mysql:5.7
  • mysqlnet: The network set up in the step above
  • mysqlserver: Make sure it matches that in LocalyzerQAConfig.groovy
  • my-secret-pw: Make sure it matches that in LocalyzerQAConfig.groovy
  • lreviewer: The database used in MySQL for LocalyzerQA.

Run the LocalyzerQA Tomcat Application Container

  docker run -dp 8085:8080 --network mysqlnet -v "/home/centos/localyzerqa/log":/usr/local/tomcat/log -v "/home/centos/localyzerqa/logs":/usr/local/tomcat/logs -v "/home/centos/localyzerqa/config":/usr/local/tomcat/lingoport ljilingoport/localyzerqadev
   docker ps

Use mysql on disk

This section and below may not be the best solution going forward. This is for reference only at this stage.


Open port 8085

Login to AWS EC2
Edit Security Group to add Dockerdev group

Allow access database remotely

  mysql -u root -p 
  grant all privileges on *.* to root@'%' identified by 'ROOT_PASSWORD';
  flush privileges;
  vi /etc/my.cnf

Add/Modify

  bind-address = 0.0.0.0
  sudo systemctl restart mysqld

Run the container

   docker run -dp 8085:8080 -v "/home/centos/localyzerqa/log":/usr/local/tomcat/log -v "/home/centos/localyzerqa/logs":/usr/local/tomcat/logs -v "/home/centos/localyzerqa/config":/usr/local/tomcat/lingoport ljilingoport/localyzerqadev
   docker ps