Docker
Accelerate how you build, test and deploy Harmony
Last updated
Accelerate how you build, test and deploy Harmony
Last updated
Harmony has adapted a clean, microservice architecture and sits on top of this to make building and deploying the entire infrastructure with just a few commands.
The following instructions will guide you to build Harmony's images and run its containers on your local machine using docker compose. In case you want to deploy to a local Kubernetes cluster read the section.
Open a PowerShell session and run the following commands to create and trust a development certificate, since all Harmony applications run under HTTPS.
The above commands are for Windows using Linux containers. If you are on a Mac or Linux you need to run:
Navigate at the root of Harmony's solution folder where the docker-compose.yml file exists and run the following commands:
Of course, there will be more changes, improvements and additions for dockerizing Harmony in the future, e.g Kubernetes support, production overrides, etc..
By default, docker will create a new SQL Server based on Microsoft's image.
In you want to connect to your host's SQL Server rather than connecting to a docker container, check the follow steps:
Remove the previous snippet from the docker-compose.yml file and any depends_on reference to it.
Enable TCP/IP access on your SQL Server instance & restart SQL Server services.
Ensure your SQL Server runs under mixed mode or at least SQL Server mode so that you can connect via user & password credentials (windows authentication won't work on a linux container!)
Change the connection string in the docker-compose.yml file to connect to your SQL Server. For localhost development, you must use host.docker.internal as the following example (use your own credentials):
In case you want to run SQL Server as a docker container but you want to persist the data and don't lose them after re-creating the container, you need to add docker volumes on the related service definition in the docker-compose.yml. Here's an example:
You can use docker managed volumes of course.
Please read the official Microsoft's for more details in case you face any problems. The previous commands used a password HarmonyTeamsSecretKey but you can use your own. If you do, change it on the docker-compose.yml file as well.
Assuming you have build and run all the containers properly, you can navigate at and confirm that the page loads smoothly.