[PR #99] [MERGED] Update React / Spring / MySQL example #211

Closed
opened 2025-11-06 14:21:19 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/docker/awesome-compose/pull/99
Author: @frgreiner
Created: 3/14/2021
Status: Merged
Merged: 3/22/2021
Merged by: @aiordache

Base: masterHead: master


📝 Commits (4)

  • 318092a Update README.md title from NodeJS to Spring
  • decd790 Always restart spring backend service
  • 0fa3076 Also pass db-password secret to spring backend
  • bbbf2b4 Add healthcheck to the mysql service

📊 Changes

4 files changed (+42 additions, -2 deletions)

View changed files

📝 react-java-mysql/README.md (+1 -1)
react-java-mysql/backend/src/main/java/com/company/project/configuration/DockerSecretsProcessor.java (+30 -0)
react-java-mysql/backend/src/main/resources/META-INF/spring.factories (+1 -0)
📝 react-java-mysql/docker-compose.yaml (+10 -1)

📄 Description

I would like to suggest the following improvements:

  • Update README.md title from NodeJS to Spring
  • Always restart spring backend service - when starting this example for the first time using docker-compose up -d the backend container fails to start as the mysql container is up and running but still initializing and not ready to accept connections. The depends_on: ... option doesn't work as expected if the mysql volume isn't initialized yet. By adding restart: always the spring backend will restart until the connection to the database can be established. This leads to a lot of exception stacktraces printed to the container log (only when started the first time), but in my opinion thats better than not starting at all.
  • Also pass db-password secret to spring backend - as the mysql container uses a secret file to set the MYSQL_ROOT_PASSWORD, the spring backend should use the secret file as well, so you can change the password.txt file without making any changes to the backend source files.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/docker/awesome-compose/pull/99 **Author:** [@frgreiner](https://github.com/frgreiner) **Created:** 3/14/2021 **Status:** ✅ Merged **Merged:** 3/22/2021 **Merged by:** [@aiordache](https://github.com/aiordache) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (4) - [`318092a`](https://github.com/docker/awesome-compose/commit/318092a7882561483f3a0f5bec39aab1403b9964) Update README.md title from NodeJS to Spring - [`decd790`](https://github.com/docker/awesome-compose/commit/decd790f191823f23d0b7c08c0268c5c87cac276) Always restart spring backend service - [`0fa3076`](https://github.com/docker/awesome-compose/commit/0fa30766c255146c80793a4e531afed3d9bc57f4) Also pass db-password secret to spring backend - [`bbbf2b4`](https://github.com/docker/awesome-compose/commit/bbbf2b44d804e219f36094ae7e4c680b8f52a1b9) Add healthcheck to the mysql service ### 📊 Changes **4 files changed** (+42 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `react-java-mysql/README.md` (+1 -1) ➕ `react-java-mysql/backend/src/main/java/com/company/project/configuration/DockerSecretsProcessor.java` (+30 -0) ➕ `react-java-mysql/backend/src/main/resources/META-INF/spring.factories` (+1 -0) 📝 `react-java-mysql/docker-compose.yaml` (+10 -1) </details> ### 📄 Description I would like to suggest the following improvements: - **Update README.md title from NodeJS to Spring** - **Always restart spring backend service** - when starting this example for the first time using `docker-compose up -d` the backend container fails to start as the mysql container is up and running but still initializing and not ready to accept connections. The `depends_on: ...` option doesn't work as expected if the mysql volume isn't initialized yet. By adding `restart: always` the spring backend will restart until the connection to the database can be established. This leads to a lot of exception stacktraces printed to the container log (only when started the first time), but in my opinion thats better than not starting at all. - **Also pass db-password secret to spring backend** - as the mysql container uses a secret file to set the MYSQL_ROOT_PASSWORD, the spring backend should use the secret file as well, so you can change the `password.txt` file without making any changes to the backend source files. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-06 14:21:19 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/awesome-compose#211