retry before stopping in docker-compose 81/140281/1
authormpriyank <priyank.maheshwari@est.tech>
Fri, 21 Feb 2025 09:48:36 +0000 (09:48 +0000)
committermpriyank <priyank.maheshwari@est.tech>
Fri, 21 Feb 2025 09:48:40 +0000 (09:48 +0000)
- configure restart policy as on-failure and set it to restart atmost 3
  times and then give up.
- prevents infinite restart
- gives an opportunity to the app to heal on its own

Issue-ID: CPS-2647
Change-Id: I6cd0c8601060ec518df1f10bcd0dac1b97f622d8
Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
docker-compose/docker-compose.yml

index 3c85200..3b7cc60 100644 (file)
@@ -79,7 +79,7 @@ services:
       JAVA_TOOL_OPTIONS: "-XX:InitialRAMPercentage=70.0 -XX:MaxRAMPercentage=70.0"
       ### DEBUG: Uncomment next line to enable java debugging
       # JAVA_TOOL_OPTIONS: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005
-    restart: no
+    restart: on-failure:3
     depends_on:
       - dbpostgresql
     deploy: