diff --git a/Dockerfile b/Dockerfile index 187c4d2..8afd9c4 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 ! pg_isready -h localhost -p 5432; do sleep 1; done && java -jar /opt/app/*.jar \ No newline at end of file