From fa7e1180a277f2ba2a9c5be39f4f9af5e64f02fe Mon Sep 17 00:00:00 2001 From: Ng Heng Khai Date: Sat, 4 May 2024 03:08:13 +0800 Subject: [PATCH] Update Dockerfile Updated the wait logic to poll and check instead. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 187c4d2..53f8b66 100644 --- a/Dockerfile +++ b/Dockerfile @@ -61,4 +61,4 @@ COPY --from=builder /opt/app/target/*.jar /opt/app/*.jar # Set the default command to run the Java application. # The ENTRYPOINT instruction specifies the command that should be run. The CMD instruction provides default arguments to the ENTRYPOINT command. # Start the PostgreSQL service, wait for it to start, then run the Java application via its Jar file. -ENTRYPOINT service postgresql start && sleep 5 && java -jar /opt/app/*.jar \ No newline at end of file +ENTRYPOINT service postgresql start && while while ! curl http://localhost:5432/ 2>&1 | grep '52'; do sleep 1; done && java -jar /opt/app/*.jar \ No newline at end of file