Skip to content

Commit bc3de36

Browse files
authored
fixes problem with healthcheck when using context path (#708)
1 parent 7367f43 commit bc3de36

6 files changed

Lines changed: 18 additions & 6 deletions

File tree

  • basyx.aasdiscoveryservice/basyx.aasdiscoveryservice.component
  • basyx.aasenvironment/basyx.aasenvironment.component
  • basyx.aasrepository/basyx.aasrepository.component
  • basyx.aasxfileserver/basyx.aasxfileserver.component
  • basyx.conceptdescriptionrepository/basyx.conceptdescriptionrepository.component
  • basyx.submodelrepository/basyx.submodelrepository.component

basyx.aasdiscoveryservice/basyx.aasdiscoveryservice.component/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ COPY ${JAR_FILE} basyxExecutable.jar
88
COPY src/main/resources/application.properties application.properties
99
ARG PORT=8081
1010
ENV SERVER_PORT=${PORT}
11+
ARG CONTEXT_PATH=/
12+
ENV SERVER_SERVLET_CONTEXT_PATH=${CONTEXT_PATH}
1113
EXPOSE ${SERVER_PORT}
12-
HEALTHCHECK --interval=30s --timeout=3s --retries=3 --start-period=15s CMD curl --fail http://localhost:${SERVER_PORT}/actuator/health || exit 1
14+
HEALTHCHECK --interval=30s --timeout=3s --retries=3 --start-period=15s CMD curl --fail http://localhost:${SERVER_PORT}${SERVER_SERVLET_CONTEXT_PATH%/}/actuator/health || exit 1
1315
ENTRYPOINT ["java","-jar","basyxExecutable.jar"]

basyx.aasenvironment/basyx.aasenvironment.component/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ COPY ${JAR_FILE} basyxExecutable.jar
88
COPY src/main/resources/application.properties application.properties
99
ARG PORT=8081
1010
ENV SERVER_PORT=${PORT}
11+
ARG CONTEXT_PATH=/
12+
ENV SERVER_SERVLET_CONTEXT_PATH=${CONTEXT_PATH}
1113
EXPOSE ${SERVER_PORT}
12-
HEALTHCHECK --interval=30s --timeout=3s --retries=3 --start-period=15s CMD curl --fail http://localhost:${SERVER_PORT}/actuator/health || exit 1
14+
HEALTHCHECK --interval=30s --timeout=3s --retries=3 --start-period=15s CMD curl --fail http://localhost:${SERVER_PORT}${SERVER_SERVLET_CONTEXT_PATH%/}/actuator/health || exit 1
1315
ENTRYPOINT ["java","-jar","basyxExecutable.jar"]

basyx.aasrepository/basyx.aasrepository.component/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ COPY ${JAR_FILE} basyxExecutable.jar
88
COPY src/main/resources/application.properties application.properties
99
ARG PORT=8081
1010
ENV SERVER_PORT=${PORT}
11+
ARG CONTEXT_PATH=/
12+
ENV SERVER_SERVLET_CONTEXT_PATH=${CONTEXT_PATH}
1113
EXPOSE ${SERVER_PORT}
12-
HEALTHCHECK --interval=30s --timeout=3s --retries=3 --start-period=15s CMD curl --fail http://localhost:${SERVER_PORT}/actuator/health || exit 1
14+
HEALTHCHECK --interval=30s --timeout=3s --retries=3 --start-period=15s CMD curl --fail http://localhost:${SERVER_PORT}${SERVER_SERVLET_CONTEXT_PATH%/}/actuator/health || exit 1
1315
ENTRYPOINT ["java","-jar","basyxExecutable.jar"]

basyx.aasxfileserver/basyx.aasxfileserver.component/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ COPY ${JAR_FILE} basyxExecutable.jar
88
COPY src/main/resources/application.properties application.properties
99
ARG PORT=8081
1010
ENV SERVER_PORT=${PORT}
11+
ARG CONTEXT_PATH=/
12+
ENV SERVER_SERVLET_CONTEXT_PATH=${CONTEXT_PATH}
1113
EXPOSE ${SERVER_PORT}
12-
HEALTHCHECK --interval=30s --timeout=3s --retries=3 --start-period=15s CMD curl --fail http://localhost:${SERVER_PORT}/actuator/health || exit 1
14+
HEALTHCHECK --interval=30s --timeout=3s --retries=3 --start-period=15s CMD curl --fail http://localhost:${SERVER_PORT}${SERVER_SERVLET_CONTEXT_PATH%/}/actuator/health || exit 1
1315
ENTRYPOINT ["java","-jar","basyxExecutable.jar"]

basyx.conceptdescriptionrepository/basyx.conceptdescriptionrepository.component/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ COPY ${JAR_FILE} basyxExecutable.jar
88
COPY src/main/resources/application.properties application.properties
99
ARG PORT=8081
1010
ENV SERVER_PORT=${PORT}
11+
ARG CONTEXT_PATH=/
12+
ENV SERVER_SERVLET_CONTEXT_PATH=${CONTEXT_PATH}
1113
EXPOSE ${SERVER_PORT}
12-
HEALTHCHECK --interval=30s --timeout=3s --retries=3 --start-period=30s CMD curl --fail http://localhost:${SERVER_PORT}/actuator/health || exit 1
14+
HEALTHCHECK --interval=30s --timeout=3s --retries=3 --start-period=30s CMD curl --fail http://localhost:${SERVER_PORT}${SERVER_SERVLET_CONTEXT_PATH%/}/actuator/health || exit 1
1315
ENTRYPOINT ["java","-jar","basyxExecutable.jar"]

basyx.submodelrepository/basyx.submodelrepository.component/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ COPY ${JAR_FILE} basyxExecutable.jar
88
COPY src/main/resources/application.properties application.properties
99
ARG PORT=8081
1010
ENV SERVER_PORT=${PORT}
11+
ARG CONTEXT_PATH=/
12+
ENV SERVER_SERVLET_CONTEXT_PATH=${CONTEXT_PATH}
1113
EXPOSE ${SERVER_PORT}
12-
HEALTHCHECK --interval=30s --timeout=3s --retries=3 --start-period=15s CMD curl --fail http://localhost:${SERVER_PORT}/actuator/health || exit 1
14+
HEALTHCHECK --interval=30s --timeout=3s --retries=3 --start-period=15s CMD curl --fail http://localhost:${SERVER_PORT}${SERVER_SERVLET_CONTEXT_PATH%/}/actuator/health || exit 1
1315
ENTRYPOINT ["java","-jar","basyxExecutable.jar"]

0 commit comments

Comments
 (0)