Skip to content

Commit

Permalink
Add healthcheck in components dockerfile (#104)
Browse files Browse the repository at this point in the history
* Add healthcheck command in dockerfile

* Use port as variable in healthcheck

* Update health endpoint

use `/actuator/health` as health endpoint

* Remove actuator config

set actuator config to default to keep docker images compatible

* Add healthcheck to AASXFileServer

Healthcheck for AASXFileServer
  • Loading branch information
mhrimaz authored Nov 16, 2023
1 parent a7cb69a commit 2f6781a
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ ARG JAR_FILE=target/*-exec.jar
COPY ${JAR_FILE} basyxExecutable.jar
COPY src/main/resources/application.properties application.properties
ARG PORT=8081
ENV PORT=${PORT}
EXPOSE ${PORT}
HEALTHCHECK --interval=30s --timeout=3s --retries=3 --start-period=15s CMD curl --fail http://localhost:${PORT}/actuator/health || exit 1
ENTRYPOINT ["java","-jar","basyxExecutable.jar"]
2 changes: 2 additions & 0 deletions basyx.aasrepository/basyx.aasrepository.component/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ ARG JAR_FILE=target/*-exec.jar
COPY ${JAR_FILE} basyxExecutable.jar
COPY src/main/resources/application.properties application.properties
ARG PORT=8081
ENV PORT=${PORT}
EXPOSE ${PORT}
HEALTHCHECK --interval=30s --timeout=3s --retries=3 --start-period=15s CMD curl --fail http://localhost:${PORT}/actuator/health || exit 1
ENTRYPOINT ["java","-jar","basyxExecutable.jar"]
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ WORKDIR /application
ARG JAR_FILE=target/*-exec.jar
COPY ${JAR_FILE} basyxExecutable.jar
COPY src/main/resources/application.properties application.properties
ARG PORT=8081
ENV PORT=${PORT}
EXPOSE ${PORT}
HEALTHCHECK --interval=30s --timeout=3s --retries=3 --start-period=15s CMD curl --fail http://localhost:${PORT}/actuator/health || exit 1
ENTRYPOINT ["java","-jar","basyxExecutable.jar"]
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ basyx.backend = InMemory
#spring.data.mongodb.uri=mongodb://mongoAdmin:mongoPassword@localhost:27017/?authMechanism=DEFAULT

# Base Path for Spring Boot Actuator
management.endpoints.web.base-path=/
# management.endpoints.web.base-path=/

####################################################################################
# Cross-Site Resource Sharing (CORS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ ARG JAR_FILE=target/*-exec.jar
COPY ${JAR_FILE} basyxExecutable.jar
COPY src/main/resources/application.properties application.properties
ARG PORT=8081
ENV PORT=${PORT}
EXPOSE ${PORT}
HEALTHCHECK --interval=30s --timeout=3s --retries=3 --start-period=30s CMD curl --fail http://localhost:${PORT}/actuator/health || exit 1
ENTRYPOINT ["java","-jar","basyxExecutable.jar"]
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ ARG JAR_FILE=target/*-exec.jar
COPY ${JAR_FILE} basyxExecutable.jar
COPY src/main/resources/application.properties application.properties
ARG PORT=8081
ENV PORT=${PORT}
EXPOSE ${PORT}
HEALTHCHECK --interval=30s --timeout=3s --retries=3 --start-period=15s CMD curl --fail http://localhost:${PORT}/actuator/health || exit 1
ENTRYPOINT ["java","-jar","basyxExecutable.jar"]
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ server.port=8081
spring.application.name=Submodel Service

# Base Path for Spring Boot Actuator
management.endpoints.web.base-path=/
# management.endpoints.web.base-path=/

####################################################################################
# Cross-Site Resource Sharing (CORS);
Expand Down
2 changes: 1 addition & 1 deletion examples/cd-repo.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ spring.data.mongodb.username=mongoAdmin
spring.data.mongodb.password=mongoPassword

# Base Path for Spring Boot Actuator
management.endpoints.web.base-path=/
# management.endpoints.web.base-path=/

0 comments on commit 2f6781a

Please sign in to comment.