Use docker to develop the UH Groupings project on a locahost environment.
The docker stack contains the following:
- Hashicorp vault container to secure the Grouper API password.
- Groupings API container featuring hot updates.
- Groupings UI container featuring hot updates.
For this project the following work remains to be done:
- Determine what should be moved from the overrides file to the Vault, and test.
- Determine how best to update the pom file for hot updates, and test.
- Docker Desktop (and a Docker Hub account)
Is the overrides file still relevant?
- Yes. It overrides properties without the danger of the changes ending up in a PR.
- The Powershell scripts are courtesy of genAI and remain to be tested.
Hot Updates to the source code can be sync'ed to the running container and force the app in the container to be restarted. Spring Boot must be configured appropriately to enable hot updates.
This is possible because the containers mount your source directories on your localhost. The purpose of the containers is simply to run the projects.
- Automatic Restart: DevTools monitors for any changes in your classpath and automatically restarts your Spring Boot application.
- Live Reload: This feature allows you to refresh your browser automatically whenever there are changes detected to resources.
- Remote Development: It can also be configured to work with applications running in containers.
(enabling DevTools is optional)
Add to Maven pom.xml:
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
</dependencies>
Add to dockerhost properties file:
# Enable automatic restart
spring.devtools.restart.enabled=true
# Disable template caches
spring.thymeleaf.cache=false
It may be necessary to add the following to the dockerhost properties file in order to ensure that hot reloading to the container works as expected.
spring.devtools.restart.polling-interval=1000
spring.devtools.restart.trigger-file=/.trigger
-
Install Docker Desktop (optional)
-
Download the project
mkdir gitclone cd gitclone git clone https://github.com/uhawaii-system-its-ti-iam/uh-groupings-docker-dev.git cd uh-groupings-docker-dev
The vault must be set up and the Grouper API password added to it before the Groupings containers are created.
cd vault
And review the README provided.
cd groupings
And review the README provided.