Business Connector deployment using Docker and Docker Compose
The Business Connector, or BC, is a component that connects your business applications to the Identity Platform.
It is a lightweight, stateless, and horizontally scalable service that is responsible for handling the communication between your business applications and the Platform.
This guide will walk you through deploying the Business Connector in a Docker container using Docker Compose.
Create a Docker Compose File
The Docker Compose file is a YAML file that contains the configuration for the Business Connector, including the image to use, the ports to expose, and the environment variables to set.
The sample Docker Compose file definition is provided in Appendix B, but you may need to customise it to suit your environment.
This config assumes that the services will share a common network, called proxy
, and that the Business Connector will be accessible from both the Studio and your internet gateway service.
If the database services are also running in the local Docker engine, you can define an additional network to sperate and secure the network traffic between the services.
See the provided Docker Compose templates for an example of how to define and use multiple networks.
Create a new file called business-connector-compose.yml
in a working directory on your PC and add the following content:
services:
one37-bc:
container_name: one37-bc
image: [provided-image-registryhost]/one37id-bc2-js/production:latest
# Optional - We don't have to expose all the ports directly as some services
# will be accessed via the internal docker networks.
# NOTE: 'admin' and 'public' internal port values are defined in the
# Business Connector Studio configuration.
# TIP: Try configure consecutive ports for easier management.
ports:
# - [bootstrap-port]:[PORT]
# - [admin-port]:[admin-port]
# - [public-port]:[public-port]
networks:
- proxy
environment:
- NODE_ENV=production
- PORT=5000
# Logs
- LOG_LEVEL=info # [Optional] Set the initial log level: [trace, debug, info (default), warning, error, critical]
- NO_COLOR="false" # Enable/Disable color output in logs
# Initial DATABASE
- PG_HOST=[your-db-host/db-container-name]
- PG_PORT=[your-db-port]
- PG_DB_AGENCY=[your-db-name]
- PG_USER=[your-db-user]
- PG_PSWD=[your-db-password]
- DB_ENCRYPTION_KEY=[your-db-encryption-key]
# METRICS
- LOCAL_METRICS_ENABLED=true # Enable local metrics collection
- STATS_BUFFER_TIME=1 # Metrics collection flush interval in minutes
# ALIAS ROUTING
# Set the alias realm of this business
- ALIAS_REALM="com.[your-business-short-name]"
# Set to the alias realm of the home business if this is a sattelite business else it will be the same as the ALIAS REALM
- HOME_ALIAS_REALM="com.[home-business-short-name]"
# Websocket coordination using REDIS
- WS_REDIS_ENABLED=true
- WS_REDIS_MONITOR_ENABLED=false
pull_policy: always
restart: always
networks:
proxy:
external: true # Use the existing network defined in the Studio Docker Compose file
name: proxy
Start the Business Connector
To start the Business Connector, run the following command in the same directory as the business-connector-compose.yml
file:
docker-compose -f business-connector-compose.yml up -d
This command will start the Business Connector and leave it running in the background.
To check the status of the Business Connector, run the following command:
docker ps
This command will list all the running containers on your Docker engine.
If the Business Connector is running, you should see a container with the name one37-bc
.
If the Business Connector fails to start, or you want to just check the logs, run the following command:
docker logs one37-bc
On the first run the output will look something like this:
[2021-09-01 12:00:00] [info] [one37-bc] Starting Business Connector...
[2021-09-01 12:00:00] [info] [one37-bc] Business Connector started successfully.
Next Steps
After you have successfully deployed and started the application, you can proceed to Workflow Engine Setup.