Skip to content

Docker Compose

This guide assumes that all prerequisites have been met. Please visit the corresponding Prerequisites page for your infrastructure provider.

Deploy Tower#

Click to view tower.env
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
 TOWER_SERVER_URL=http://localhost:8000
 TOWER_CONTACT_EMAIL=admin@your-org.com
 TOWER_JWT_SECRET=<Replace This With A Secret String containing at least 35 characters>
 TOWER_CRYPTO_SECRETKEY=<Replace This With Another Secret String>
 TOWER_LICENSE=<YOUR TOWER LICENSE KEY>

 # Compute environment settings
 TOWER_ENABLE_PLATFORMS=awsbatch-platform,azbatch-platform,gls-platform,k8s-platform,slurm-platform

 # DB settings
 TOWER_DB_URL=jdbc:mysql://db:3306/tower
 TOWER_DB_DRIVER=org.mariadb.jdbc.Driver
 TOWER_DB_DIALECT=io.seqera.util.MySQL55DialectCollateBin
 TOWER_DB_USER=tower
 TOWER_DB_PASSWORD=tower
 FLYWAY_LOCATIONS=classpath:db-schema/mysql

 # SMTP settings 
 TOWER_SMTP_HOST=mail
 TOWER_SMTP_PORT=587
 TOWER_SMTP_USER=foo
 TOWER_SMTP_PASSWORD=foo
Click to view tower.yml
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 # e.g.  Configure a local SMTP server
 # DO NOT USE IN PRODUCTION ENVIRONMENT
 # 
 # Replace these settings with a SMTP server 
 # provided by your cloud vendor

 tower:
   trustedEmails:
     - '*@org.xyz'
     - 'named_user@org.xyz'

 mail:
   from: "${TOWER_CONTACT_EMAIL}"
   smtp:
     host: ${TOWER_SMTP_HOST}
     port: ${TOWER_SMTP_PORT}
     user: ${TOWER_SMTP_USER}
     password: ${TOWER_SMTP_PASSWORD}
     # `auth` and `starttls` should be enabled
     # with a production SMTP host
     auth: false
     starttls:
       enable: false
       required: false
Click to view docker-compose.yml
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
 version: "3"
 services:

   db:
     image: mysql:5.6
     networks:
       - backend
     expose:
       - 3306
     environment:
       MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
       MYSQL_USER: tower
       MYSQL_PASSWORD: tower
       MYSQL_DATABASE: tower
     restart: always
 # enable this snippet to store the Mysql data in the host volume
 #    volumes:
 #      - $HOME/.tower/db/mysql:/var/lib/mysql

   redis:
     image: public.ecr.aws/seqera-labs/redis:5.0.8
     networks:
       - backend
     expose:
       - 6379
     command: --appendonly yes
     restart: always
 # enable this snippet to store the Redis data in the host volume
 #    volumes:
 #      - $HOME/.tower/db/redis:/data

   cron:
     image: ${REPOSITORY_URL}/backend:${TAG}
     command: -c '/wait-for-it.sh db:3306 -t 60; /migrate-db.sh; /tower.sh'
     networks:
       - frontend
       - backend
     volumes:
       - $PWD/tower.yml:/tower.yml
     env_file:
       - tower.env
     environment:
       - MICRONAUT_ENVIRONMENTS=prod,redis,cron
     restart: always
     depends_on:
       - db
       - redis

   backend:
     image: ${REPOSITORY_URL}/backend:${TAG}
     command: -c '/wait-for-it.sh db:3306 -t 60; /tower.sh'
     networks:
       - frontend
       - backend
     expose:
       - 8080
     volumes:
       - $PWD/tower.yml:/tower.yml
     env_file:
       - tower.env
     environment:
       - MICRONAUT_ENVIRONMENTS=prod,redis,ha
     restart: always
     depends_on:
       - db
       - redis
       - cron

   frontend:
     image: ${REPOSITORY_URL}/frontend:${TAG}
     networks:
       - frontend
     ports:
       - 8000:80
     restart: always
     depends_on:
       - backend

 networks:
   frontend: {}
   backend: {}
  1. Download and configure tower.env.

  2. Download and configure tower.yml, update values for allowed emails.

  3. Download and configure docker-compose.yml.

    The db and mail containers should only be used for local testing; you may remove them if you have set up these services elsewhere.

    Make sure to customize the TOWER_ENABLE_PLATFORMS variable to include the execution platform(s) you will use.

  4. Download the appropriate script for the container registry you wish to use:

    This script simply defines the repository URL and tag of the Tower container images. Refer to the corresponding Prerequisites page for instructions on how to authenticate Docker to pull these images.

  5. Deploy Tower and wait for it to initialize (takes a few minutes):

    1
    2
    source env-*.sh
    docker-compose up
    

Note

For more information on configuration, please visit Configuration options.

Test the application#

To make sure that Tower is properly configured, please follow these steps:

  1. Login to Tower.

  2. Create an organization.

  3. Create a workspace within that organization.

  4. Create a new Compute Environment. Refer to Compute Environments for detailed instructions.

  5. Select Quick Launch from the Launchpad tab in your workspace.

  6. Enter the repository URL for the nf-core/rnaseq pipeline (https://github.com/nf-core/rnaseq).

  7. In the Config profiles dropdown, select the test profile.

  8. In the Pipeline parameters textarea, change the output directory to a sensible location based on your Compute Environment:

    1
    2
    3
    4
    5
    # save to S3 bucket
    outdir: s3://<your-bucket>/results
    
    # save to scratch directory (Kubernetes)
    outdir: /scratch/results
    

  9. Select Launch.

    You'll be transitioned to the Runs tab for the workflow. After a few minutes, you'll see the progress logs in the Execution log tab for that workflow.

Tip

Once you've made sure that Tower is configured correctly and you can launch workflows, you can run docker-compose up -d to deploy Tower as a background process, so that you can disconnect from the VM instance.

Back to top