Deploying Tines on Docker Compose

Step 1. Install Netcat 

To install netcat, run the following:

AWS Linux or RedHat/CentOS:

sudo yum install nc

Ubuntu or Debian:

sudo apt-get install nc

Step 2. Install Docker 

To install docker, run the following:

AWS Linux or RedHat/CentOS:

sudo yum install docker

Ubuntu or Debian:

sudo apt-get install docker

💡Note

Step 3. Install docker-compose 

To install docker-compose, run the following:

# Replace {version} with the version of docker-compose you want to download
curl -L "https://github.com/docker/compose/releases/download/{version}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

chmod +x /usr/local/bin/docker-compose

ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

💡Note

Step 4. Create Installation Directory  

Create a directory for the Tines installation, for example, /opt/tines:

sudo mkdir /opt/tines

Step 5. Create tines.crt and tines.key Files 

To create the tines.crt and tines.key files, run the following command within your installation directory:

sudo openssl req -x509 -out /opt/tines/tines.crt -keyout /opt/tines/tines.key -newkey rsa:2048 -nodes -sha256

Example

[ec2-user@ip-172-31-13-57 tines]$ sudo openssl req -x509 -out /opt/tines/tines.crt -keyout /opt/tines/tines.key -newkey rsa:2048 -nodes -sha256

Generating a 2048-bit RSA private key

..........................................+++

.....................................+++

writing new private key to '/opt/tines/tines.key'

-----

You are about to be asked to enter information that will be incorporated

into your certificate request.

What you are about to enter is what is called a Distinguished Name or a DN.

There are quite a few fields but you can leave some blank.

For some fields, there will be a default value,

If you enter '.', the field will be left blank.

-----

Country Name (2 letter code) [XX]:US

State or Province Name (full name) []:Massachusetts

Locality Name (eg, city) [Default City]:Boston

Organization Name (eg, company) [Default Company Ltd]:Tines

Organizational Unit Name (eg, section) []:Support

Common Name (eg, your name or your server's hostname) []:ec2-44-192-9-108.compute-1.amazonaws.com

Email Address []:yourname@yourcompany.com

[ec2-user@ip-172-31-13-57 tines]$ ls

commands.sh  docker-compose.yml  docs  postgres.tar  redis.tar  setup.sh  tines-app.tar  tines.crt  tines.key  tines-nginx.tar  upgrade.sh

[ec2-user@ip-172-31-13-57 tines]$ 

Step 6. Generate Secret Token 

To generate the app secret token, run the following on your Linux host:

openssl rand -hex 64

Step 7. Download the Installation Package  

To download the installation package, follow these steps:

  1. Send an email to support@tines.io and request that your cloud tenant be enabled to allow the download of the self-hosted installation package.

  2. Once Tines Support has enabled the self-hosted installation package download, visit the /admin/upgrade page on your cloud tenant to download the installation package. The file will be a zip archive named as follows: tines_<build id>.zip. The installation package contains the following files:

Tines Self-Hosted Installation Package Files 

Filename and Description

  • docker-compose.yml

    • Configuration file for Docker Compose

  • .env.tmpl

    • Tines environment setting. Needs to be edited.

  • postgres.tar

    • Postgres docker image

  • redis.tar

    • Redis Docker image

  • tines-app.tar

    • Tines application Docker image

  • tines-nginx.tar

    • Tines nginx docker image

  • upgrade.sh

    • Script to upgrade between Tines versions

  • setup.sh

    • Script to install Tines

Step 8. Upload the Tines Application .zip File  

Upload the Tines application .zip file to your AWS S3 bucket and copy it over to your Linux host as follows:

ec2-user@ip-172-31-13-57 ~]$ sudo aws s3 cp s3://tines-test-env/tines_3cb262aa_v12_0_3.zip /tmp/

If you don’t have access to the S3 bucket from your Linux host, you can use scp with your private key, as shown below:

C:\Users\Ben\Downloads>scp -i BenTest.pem tines_3cb262aa_v12_0_3.zip ec2-user@ec2-44-192-9-108.compute-1.amazonaws.com:tines_3cb262aa_v12_0_3.zip

The authenticity of host 'ec2-44-192-9-108.compute-1.amazonaws.com (44.192.9.108)' can't be established.

ECDSA key fingerprint is SHA256:4uSIhoRWK9PemgpfLh8l/gY0Ng/XFlr4t0x/aK4sSkY.

Are you sure you want to continue connecting (yes/no/[fingerprint])?

Please type 'yes', 'no' or the fingerprint:

Warning: Permanently added 'ec2-44-192-9-108.compute-1.amazonaws.com,44.192.9.108' (ECDSA) to the list of known hosts.

tines_3cb262aa_v12_0_3.zip                                                            100%  368MB 2.9MB/s 02:08

Step 9. Move Files to Installation Directory  

Unzip the installation package and move all files to the installation directory:

unzip tines_<build_id>.zip

cp -rT tines_<build_id>/ /opt/tines

Step 10. Create a .env file using.env.tmpl  

The .env file contains Tines environment variables and is used to configure the Tines instance. 

To edit the .env.tmpl file (you can also find it at ENV configuration), follow these steps: 

  1. Open the .env.tmpl file using a text editor. 

  2. Using the information that you recorded in the “.env File Configuration Information Sheet” step, update the following two sections of the .env.tmpl file to reflect your environment: Tenant Configuration and Email Configuration.

    Tenant Configuration: Enter basic information about the tenant, including its name, seed user details (the first user account that will be created) and domain (the FQDN).

    Email Configuration: Enter SMTP server details. Tines will use these when sending emails.

3. After updating the file, save it as .env.

Step 11. Run Setup Script  

Your installation directory should now contain the following files:

  • docker-compose.yml

  • .env (updated and renamed)

  • postgres.tar

  • redis.tar

  • tines-app.tar

  • tines-nginx.tar

  • tines.crt

  • tines.key

  • upgrade.sh

  • setup.sh

Use the following command to run the Tines setup script:

bash setup.sh

Upon completion of the installation and the startup of the services and containers, a verification email will be sent to the email address that you specified in the SEED_EMAIL entry of the .env file. To verify the installation and to launch the Tines dashboard, click on the link provided in the email.

Was this helpful?