To run the Control Center, you can deploy it using a web server such as Nginx for hosting the frontend, while the backend runs as a Java application. The Control Center can be run locally or containerized using Docker.
To run the Control Center as a standalone Java application without Docker:
cc-config.yaml file with your database connection details. See Defining the System Database for configuration guidance.In the example below, Nginx is used and configured to access the Control Center.
Follow the steps below to configure Nginx to host the Control Center frontend.
http {
...
server {
...
#AMT Control Center Frontend
location /control-center {
alias C:\AMT\AMT-Java\Binaries\control-center-frontend;
try_files $uri $uri/ /index.html =404;
}
#API requests from the Control Center
location /control-center/api {
rewrite ^/control-center(.*)$ $1 break;
proxy_pass https://127.0.0.1:9001;
}
...
}
...
}java -jar C:\AMT\AMT-Java\Binaries\control-center-backend\control-center-server-pekko-x.x.x.jar -cf "C:\AMT\AMT-Java-Client\Config\cc-config.yaml" -lf "C:\AMT\AMT-Java\Config\AmtRuntime.lic"
nginx start
We will be using Rancher in our examples to manage the Docker container for the Control Center.
aka.ms/wslinstall.wsl --install.The container will be a composite of the Control Center backend, frontend (through Nginx), and a system database (through PostgreSQL).
An image of the Control Center backend and frontend is necessary.
Pull the image provided by Avanade using the following command:
docker pull <address>/control-center-server-java
Set up a folder structure for the Docker container to contain the Docker compose.yaml, configuration
file, and license file.
C:\AMT\amt-java-docker\
compose.yaml
C:\AMT\amt-java-docker\config\
cc-config.yaml
AmtRuntime.lic
Simple configuration file for the Control Center. This is a minimal local solution serving as an example, not suited for production environments.
Note the usage of host.docker.internal instead of localhost.
---
name: AMT Control Center Java Config
environment: DEV
node:
host: 0.0.0.0
restPort: 9001
systemDatabase:
type: POSTGRES
settings:
name: amtsystem
schema: amtsystem
username: <username>
password: <password>
driverClassname: org.postgresql.Driver
url: jdbc:postgresql://host.docker.internal:5432/amtsystem
hibernateDialect: org.hibernate.dialect.PostgreSQLDialect
connectionPoolSize: 200
authentication:
type: OIDC
clients:
rest:
settings:
issuerURL: http://localhost:8080/realms/AMTRealm
clientID: AMT
returnUrl: http://localhost:4200/control-center
...Simple configuration for the Docker Compose file.
services:
# PostgreSQL Database
postgres:
image: postgres:15
container_name: amt-postgres
environment:
POSTGRES_DB: amtsystem
POSTGRES_USER: <username>
POSTGRES_PASSWORD: <password>
ports:
- "5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
# Control Center Backend
control-center-backend:
image: amt-java/control-center-server-java
container_name: amt-control-center-backend
depends_on:
postgres:
condition: service_healthy
ports:
- "9001:9001"
volumes:
- ./config:/config:ro
environment:
- JAVA_OPTS=
command: >
java
-jar /.../control-center-server/control-center-server-pekko.jar
-cf /config/cc-config.yaml
-lf /config/AmtRuntime.lic
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9001/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Control Center Frontend
control-center-frontend:
image: amt-java/control-center-server-angular
container_name: amt-control-center-frontend
ports:
- "4200:80"
depends_on:
- control-center-backend
volumes:
postgres-data:With the image pulled and the folder structure set up, run the following command from the folder containing the
compose.yaml file to start the container:
docker compose up -d
To stop the container, run the following command from the same folder:
docker compose down