Installation under Docker Swarm (Python 3.x)

This image includes the last Zato version with an entrypoint script that can be used for every Zato component.

Requirements

  • Docker Compose
  • Docker Machine

Docker image

Download the Docker image for local usage:

host$ sudo docker pull registry.gitlab.com/zatosource/docker-registry/cloud:3.1-py27

Start a local Docker Swarm

  • Start a virtual machine
host$ docker-machine create default
  • Set up the environment for the Docker client to access the Docker Swarm
host$ eval $(docker-machine env default)
  • Initialize Docker Swarm
host$ docker swarm init --advertise-addr $(docker-machine ip default)

Deploy Zato to local Docker Swarm

  • Clone GitHub repository to the the template
host$ git clone https://github.com/zatosource/zato-build.git
host$ cd zato-build/docker/swarm/
  • Install Dockerize . It will be used to create the docker-compose.yml file using environment variables.
  • Edit the file environment and customize the environment variables. SECRET_KEY and JWT_SECRET_KEY variables are mandatory.
  • Generate the docker-compose.yml with your values from environment
host$ dockerize -env environment -template docker-compose.yml.template:docker-compose.yml
  • Set up the environment for the Docker client to access the Docker Swarm
host$ eval $(docker-machine env default)
  • Deploy Zato to Docker Swarm
host$ docker stack deploy -c docker-compose.yml zato
  • Set up the environment for the Docker client to access the Docker Swarm
host$ eval $(docker-machine env default)
  • Check logs of Zato server 1 (container name will be different)
host$ docker logs -f zato_zato_server.1.c21pmddnwlh0vh0wt8ap6cw8j
  • Confirm access to Zato servers
host$ curl http://$(docker-machine ip default):17010/zato/ping
{"zato_env": {"details": "", "result": "ZATO_OK", "cid": "93bf40452dc0cc2a9d548614"}, "zato_ping_response": {"pong": "zato"}}
  • Get the URL for web-admin
host$ echo http://$(docker-machine ip default):8183
http://192.168.99.138:8183

Environment variables available

The image uses several environment variables which can be used to fine-tune the resulting installation.

They are not required to use, and default values will be substituted if any is missing, but they may be employed to configure particular details of each of the components.

Variable Notes
CLUSTER_NAME Cluster name.
LB_HOSTNAME Load balancer hostname. Used to communicate to the servers.
LB_PORT Load balancer port. Used to communicate to the servers.
ZATO_POSITION Specify the Zato component for this container. Must be one of: load-balancer (used only to create the ODB and the cluster), scheduler, server and webadmin.
ZATO_WEB_ADMIN_PASSWORD Password for the web admin’s technical account user to connect with. If not defined, the value is generated automatically at runtime.
ZATO_IDE_PUBLISHER_PASSWORD Password for user ide_publisher, used for IDE integration. If not defined, the value has to be set manually.
ZATO_ADMIN_INVOKE_PASSWORD Password used for internal communication. If not defined, the value has to be set manually.
ZATO_ENMASSE_FILE Full path or URL to an enmasse file with object definitions to been imported.
REDIS_HOSTNAME Redis service hostname. Default value is localhost.
ODB_TYPE ODB type to use. Must be one of: mysql or postgresql.
ODB_HOSTNAME ODB hostname.
ODB_PORT ODB port.
ODB_NAME ODB database.
ODB_USERNAME ODB username.
ODB_PASSWORD ODB password.
SECRET_KEY A random secret key previously generated with zato crypto create-secret-key. It is used to encrypt passwords and other sensitive data in ODB. Must be the same for all servers in a single cluster. If not provided, a new key will be generated automatically.
JWT_SECRET_KEY A random secret key previously generated with zato crypto create-secret-key. Used by JWT security definitions. If JWT is used, must be the same for all servers in a single cluster. If not provided, a new key will be generated automatically.
VERBOSE Verbose output in logs.