How to Install Exalate for GitHub on Docker?

    This article shows how to install the Exalate app for GitHub on the server using Docker.

    You need to install Docker.  Check the Docker documentation for more details.

    How to Install Exalate for GitHub?

    Check the release notes for the latest version.

    1. Create or download the docker-compose.yml

    The below example docker-compose.yml file can be used to install Exalate for GitHub.

    1. Create a directory that would hold the docker-compose file:

    2. Move into the newly created directory and create a docker-compose.yml file using your favorite editor:


      The file should contain the following information:

      version: '2'
      
      services:
        database:
          restart: unless-stopped
          image: postgres:9.6
          volumes:
            - ./persist/db:/var/lib/postgresql/data
            - ./createdb.sh:/docker-entrypoint-initdb.d/init-user-db.sh
          environment:
            - POSTGRES_PASSWORD=changeme
            - DB_NAME=githubnode
            - DB_USER=idalko
            - DB_PASS=idalko
          networks:
            - dbnet
      
        githubnode:
          restart: unless-stopped
          ports:
            - 9302:9002
      
          #
          # Change the image tag to the required version
          # Check Release History on docs.exalate.com for an overview
          #
          image: idalko/githubnode:5.4.3
          depends_on:
            - database #wait for postgres to be started, not for ready
          volumes:
            - ./persist/home:/opt/githubnode/data
          environment:
            # Add your enviroment settings here
            - GITHUBNODE_PG_HOST=database
            - GITHUBNODE_PG_DB=githubnode
            - GITHUBNODE_PG_USER=idalko
            - GITHUBNODE_PG_PWD=idalko
            - GITHUBNODE_PORT=9302
          networks:
            - dbnet
            - default
      
      networks:
        dbnet:
          driver: bridge
        default:
          driver: bridge
      
      
      

      Notes:

      1. Line 6: Choose the correct version of PostgreSQL
      2. Line 21: Please add the correct ports. 
      3. Line 27: Please choose the latest stable release from here.
      4. Line 38: Use the correct port here. 
      5. Optionally, you can set up a reverse proxy such as nginx in order to terminate SSL connections.

    2. Ensure that a correct database is setup using a createdb.sh

    Create createdb.sh (referenced from docker-compose.yml):

    #!/bin/bash
      
    TEST=`psql -U postgres <<-EOSQL
       SELECT 1 FROM pg_database WHERE datname='$DB_NAME';
    EOSQL`
      
    echo "******CREATING DOCKER DATABASE******"
    if [[ $TEST == "1" ]]; then
        # database exists
        # $? is 0
        exit 0
    else
    psql -U postgres <<-EOSQL
       CREATE ROLE $DB_USER WITH LOGIN ENCRYPTED PASSWORD '${DB_PASS}' SUPERUSER;
    EOSQL
      
    psql -U postgres <<-EOSQL
       CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCODING 'UNICODE' LC_COLLATE 'C' LC_CTYPE 'C' TEMPLATE template0;
    EOSQL
      
    psql -U postgres <<-EOSQL
       GRANT ALL PRIVILEGES ON DATABASE $DB_NAME TO $DB_USER;
    EOSQL
    fi
      
    echo ""
    echo "******DOCKER DATABASE CREATED******"

    3. Set environment variables if necessary

    Below, you can find the environment variables used for the app container. All of them are optional, and in the given example, we've overridden GITHUBNODE_PG_DB, GITHUBNODE_PG_USER, and GITHUBNODE_PG_PWD just to show how to pass different credentials to the Exalate application.

     Full list of environment variables:
    Variable nameDefault valueExampleDescription
    GITHUBNODE_PG_HOSTGITHUBNODE_PG_HOST=databaseGITHUBNODE_PG_HOST=db.acme.comtells the exalate application where is the postgres database to connect to hosted
    GITHUBNODE_PG_DBGITHUBNODE_PG_DB=githubnodeGITHUBNODE_PG_DB=exalatetells the exalate application what is the postgres database name for the exalate application
    GITHUBNODE_PG_USERGITHUBNODE_PG_USER=idalkoGITHUBNODE_PG_USER=exalatetells the exalate application what is the postgres database username for the exalate application to perform queries with
    GITHUBNODE_PG_PWDGITHUBNODE_PG_PWD=idalkoGITHUBNODE_PG_PWD=secrettells the exalate application what is the postgres database user's password for the exalate application to perform queries with
    GITHUBNODE_PORTGITHUBNODE_PORT=9000GITHUBNODE_PORT=8080

    tells what which is the port to start the exalate application on. Note that this is the port within the exalategitnode_githubnode_1 container, thus if this variable is changed (for example to 80), the

        ports:
          - 9000:9000

    should also be changed to

        ports:
          - 8080:8080


    GITHUBNODE_SMTP_HOST_NAMEGITHUBNODE_SMTP_HOST_NAME=mail.server.comGITHUBNODE_SMTP_HOST_NAME=smtp.gmail.comis used to send email notifications about errors blocking synchronization
    GITHUBNODE_SMTP_PORTGITHUBNODE_SMTP_PORT=465GITHUBODE_SMTP_PORT=587is used to send email notifications about errors blocking synchronization
    GITHUBNODE_SMTP_FROMGITHUBNODE_SMTP_FROM=admin@admin.comGITHUBNODE_SMTP_FROM=my.name@gmail.comis used to send email notifications about errors blocking synchronization
    GITHUBNODE_SMTP_USERGITHUBNODE_SMTP_USER=adminGITHUBNODE_SMTP_USER=my.nameis used to send email notifications about errors blocking synchronization
    GITHUBNODE_SMTP_PASSGITHUBNODE_SMTP_PASS=1234567GITHUBNODE_SMTP_PASS=secretis used to send email notifications about errors blocking synchronization
    GITHUBNODE_SMTP_TLSGITHUBNODE_SMTP_TLS=trueGITHUBNODE_SMTP_TLS=trueis used to send email notifications about errors blocking synchronization. Can be set to false, but then the GITHUBNODE_SMTP_PORT should be set to the port, that accepts non-SSL and non-TLS connections

    4. Start the application

    $ docker-compose up -d

    You can verify the status by using:

    • docker-compose ps
    • docker-compose logs

    5. Verify the installation

    After performing the aforementioned steps and checking that the container is up, you should be able to access the Exalate console via http://localhost:9302

    Note: You might need to set up local port forwarding in order to get this to work. 

    Please continue to set up your GitHub node by following the guide

    Register the Node in the Mapper

    The node needs to be registered in the exalate mapper.  The exalate mapper is a kind of DNS service, mapping instances to nodes
    Please raise a ticket on the support portal providing

    • URL of the GitHub instance
    • URL of the Exalate node which has been deployed on premise

    How to Manage the Application on Docker?

    Run Queries to the Application's Database

    cd ~/exalate-gitnode
    docker exec -it exalate-gitnode_database_1 bash
    su postgres
    psql -A $DB_NAME

    You can find all tables using psql's \dt+ command: 

    \dt+

    All the postgres SQL queries are permitted

    To exit the application's DB:

    \q
    # \q exits the psql 
    exit
    # exits the postgres user session
    exit
    # exits the exalate-gitnode_database_1 bash session

    Inspect the application's filesystem

    cd ~/exalate-gitnode
    docker exec -it exalate-gitnode_githubnode_1 bash

    Remove the application

    cd ~/exalate-gitnode
    docker-compose rm

    Remove the application data

    Danger zone – do this only if you wish to lose all the synchronization information, including the current synchronizations enqueued to be performed and synchronization status. 

    Be sure that the remote side (you exalate issues with) knows that you're stopping synchronization and are ready to handle synchronization errors.

    cd ~/exalate-gitnode
    # docker volume ls | grep exalate-gitnode_vol |  awk '{ print $2 }' | xargs docker volume rm
    docker volume rm exalate-gitnode_voldatabase
    docker volume rm exalate-gitnode_volgithubnode

    Troubleshooting

    Problems during the installation of the Exalate server for GitHub

    If you have problems during the installation of the Exalate app for GitHub, you can find logs describing possible problem inside /tmp.

    The name for the file is generated randomly and automatically by the OS, but you can find the file by the creation date.

    Problems while running the Exalate server for GitHub

    Logs will be generated under the directory: /opt/githubnode/data/logs.

    Refer to these logs to get more information about possible issues and communicate with our support if you need any assistance.

    Support

    Check our Support options.

    Video Tutorial

    Check out our video on how to install Exalate for GitHub using Docker.