Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You can debug our app locally on your local machine using  e g. Intellij IDE.

Our app includes 4 components:

  • Catalog QT Web Services 
  • Update Process
  • Imas Inotify
  • MySQL

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 dockerfileDockerfile, which creates one container.

...

Let's get through each debbuging path. 


 Local docker-compose debugging


Info
Things you must

...

do BEFORE building the image:



Catalog

...

WS in docker-compose debugging

To debug catalog-ws-server you need to add specific lines to docker-compose.override.yaml in server section

Code Block
languagejava

...

 server:
    volumes:
      - ./imasdb:/home/imas/public/imasdb
      - ./build/catalog_qt_2:/catalog_qt_2 #1
    ports:
      - 5005:5005 #2
    environment: 
      - DEBUG=1 #3
 
  1. 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.

  2. Exposes port for Java debugger, usually 5005.

  3. Enables debugging on catalog-ws-server.



You also need to run

Code Block
echo '' > build/files/server/application.properties.patch


and in catalog_qt_2/server/catalog-ws-server/src/main/resources/application.properties change

Code Block
languagejava
themeEclipse
-spring.datasource.url=jdbc:mysql://localhost:3306/itm_catalog_qt?serverTimezone=UTC
+spring.datasource.url=jdbc:mysql://db:3306/itm_catalog_qt?serverTimezone=UTC

After that you can build the image with debugging WS turned on.

Update Process in docker-compose debugging

Imas Inotify in docker-compose debugging

Mysql in docker-compose debbuging






Running tests

You can run unit tests by changing directory to: ws/catalog-ws and running.

...