...
Info | ||
---|---|---|
Note that you can use different port number for `Spring Boot` application
|
Debugging
In our application we have several different debugging paths depending on the docker environment and what you want to debug.
You can debug our app locally on your local machine using e g. Intellij IDE.
We have two docker containers:
- docker compose - the app is built of independent dockers that are connected to each other. According to the idea of microservices.
- single-container - mailny used by developers, all components are built on the basis of one dockerfile, which creates one container.
Let's get through each debbuging path.
- Local docker-compose debugging
Things you must do BEFORE building the image:
Catalog-ws-server
To debug catalog-ws-server you need to add specific lines to docker-compose.override.yaml
in server
section
server: volumes: - ./imasdb:/home/imas/public/imasdb - ./build/catalog_qt_2:/catalog_qt_2 #1 ports: - 5005:5005 #2 environment: - DEBUG=1 #3
Maps your code on host machine to the code inside container, allowing you to use your favourite IDE debugger capabilities. Also, you can change your code and run
docker-compose restart
to rerun container. This allows container to integrate your newest code.Exposes port for Java debugger, usually
5005
.Enables debugging on catalog-ws-server.
You also need to run
echo '' > build/files/server/application.properties.patch
and in catalog_qt_2/server/catalog-ws-server/src/main/resources/application.properties
change
-spring.datasource.url=jdbc:mysql://localhost:3306/itm_catalog_qt?serverTimezone=UTC +spring.datasource.url=jdbc:mysql://db:3306/itm_catalog_qt?serverTimezone=UTC
Running tests
You can run unit tests by changing directory to: ws/catalog-ws
and running.
...