Docker Compose
Docker provides a way to run containers locally on a machine, whether you are on Windows, macOS, or a Linux distribution.
These instructions will set up a local platform deployment using the Indicium Application Tier and the Universal GUI. To route the inbound traffic to the correct applications, a service with the container image traefik is used. Traefik uses the labels applied to the services to route traffic to the correct service, which in this case is path-based. Traefik will also redirect any traffic from HTTP to HTTPS with a self-signed certificate.
Prerequisites
- Docker or Docker Desktop for Linux/macOS/Windows
- Logged in to the Thinkwise Container Registry with an authentication token, for more information see Thinkwise Container Registry - Authentication
- A database server containing an Intelligent Application Database
It is recommended to use a source-code editor like Visual Studio Code.
Docker Desktop is only free to use as part of the Docker Personal subscription, for individuals, non-commercial open source developers, students and educators, and small businesses of fewer than 250 employees AND less than $10 million in revenue.
For more information, see https://www.docker.com/pricing/
Deployment steps
- Create a directory with a name, for example Thinkwise-Platform-Containers, and open it in the preferred source-code editor.
- Create a file with the name
docker-compose.yaml
and add the following:
---
version: "3.8"
services:
proxy:
image: traefik
ports:
- 80:80
- 443:443
command:
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--entrypoints.web.http.redirections.entrypoint.to=websecure"
- "--entrypoints.web.http.redirections.entrypoint.scheme=https"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
universal:
image: registry.thinkwisesoftware.com/public/universal:${TAG}
environment:
- SERVICE_URL=https://${EXTERNAL_HOST}/indicium/iam/iam
labels:
- "traefik.enable=true"
- "traefik.http.routers.frontend.rule=Host(`${EXTERNAL_HOST}`)"
- "traefik.http.routers.frontend.tls=true"
indicium:
image: registry.thinkwisesoftware.com/public/indicium:${TAG}
environment:
- SQL_SERVER=${SQL_SERVER}
- SQL_DATABASE=${SQL_DATABASE}
- SQL_USERNAME=${SQL_USERNAME}
- SQL_PASSWORD=${SQL_PASSWORD}
- ENABLE_REVERSE_PROXY=true
- ALLOWED_HEADERS=All
- TRUSTED_NETWORKS=0.0.0.0/0
- EXTERNAL_PATH_BASE=/indicium
labels:
- "traefik.enable=true"
- "traefik.http.routers.backend.rule=(Host(`${EXTERNAL_HOST}`) && PathPrefix(`/indicium`))"
- "traefik.http.middlewares.backend.stripprefix.prefixes=/indicium"
- "traefik.http.routers.backend.middlewares=backend"
- "traefik.http.routers.backend.tls=true"
- Create a file with the name .env (the dot in front of the file is important). Enter the correct values:
# Version of the images to pull
TAG=latest
# Hostname/IP address to access the platform on the web
EXTERNAL_HOST=localhost
# Hostname/IP address of the database server
SQL_SERVER=
# Database to use
SQL_DATABASE=IAM
# Username to access the database,
SQL_USERNAME=
# Password to access the database
SQL_PASSWORD=
In Visual Studio Code, the integrated terminal can be toggled by pressing Ctrl + ` (backtick).
- To validate and view the configuration, execute
docker compose config
- Type the command
docker compose up -d
(remove-d
to put the command in the foreground) and wait for the container images to be pulled and all the defined services to be started. Docker will load the variables from the .env file. In this case, the tag latest is specified.
Within a minute, the Universal GUI and Indicium Application Tier should be available on localhost and localhost/indicium with a self-signed certificate.
Applying an update
To change the version of the Indicium Application Tier and Universal GUI, follow these steps:
- Open the .env file in the preferred editor.
- Modify value of TAG to a different version and save it.
- Execute the command
docker compose up -d
.
A new version of the Indicium Application Tier and Universal GUI are now accessible on localhost.