Skip to content

Commit

Permalink
fix health check configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
DivineThreepwood committed Nov 6, 2023
1 parent 3f2fde9 commit e09d606
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
5 changes: 3 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ ENV \
BCO_HOME="/home/bco/data" \
BCO_LOGS="/home/bco/data/log" \
BCO_BINARY="/usr/bin/bco" \
BCO_OPTIONS=""
MQTT_BROKER="mqtt-broker" \
BCO_OPTIONS="--host ${MQTT_BROKER}"

# Basic build-time metadata as defined at http://label-schema.org
LABEL org.label-schema.build-date=$BUILD_DATE \
Expand Down Expand Up @@ -111,7 +112,7 @@ ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]

# Configure healthcheck
# todo: make sure only the registry availability is checks since devices are not maintained by this instance.
HEALTHCHECK --interval=15m --timeout=2m CMD bco-validate >/dev/null || exit 1
HEALTHCHECK --interval=15m --timeout=2m CMD bco-validate --host ${MQTT_BROKER} > /dev/null || exit 1

# switch to root, let the entrypoint drop back to bco user
USER root
Expand Down
4 changes: 2 additions & 2 deletions docker/bco-demo/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ FROM openbaseorg/bco:${BCO_BASE_IMAGE_VERSION}
ENV \
JAVA_OPTS="" \
OPENHAB_CONF="/etc/openhab2" \
BCO_OPTIONS="--db /tmp/bco/db" \
BCO_OPTIONS="--db /tmp/bco/db --host ${MQTT_BROKER}" \
BCO_MODULE_PREPARE_SCRIPT="bco-module-prepare.sh"

# Basic build-time metadata as defined at http://label-schema.org
Expand Down Expand Up @@ -51,7 +51,7 @@ COPY --from=builder /workspace/db /usr/share/bco/db/

# Configure healthcheck
# todo: make sure only device offered by this device manager are checked
HEALTHCHECK --interval=15m --timeout=2m CMD bco-validate >/dev/null || exit 1
HEALTHCHECK --interval=15m --timeout=2m CMD bco-validate --host ${MQTT_BROKER} >/dev/null || exit 1

# switch to root, let the entrypoint drop back to bco user
USER root
Expand Down
3 changes: 1 addition & 2 deletions docker/device-manager/openhab/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ FROM openbaseorg/bco:${BCO_BASE_IMAGE_VERSION}
ENV \
JAVA_OPTS="" \
OPENHAB_CONF="/etc/openhab2" \
BCO_OPTIONS="" \
BCO_MODULE_PREPARE_SCRIPT="bco-module-prepare.sh"

# Basic build-time metadata as defined at http://label-schema.org
Expand All @@ -33,7 +32,7 @@ RUN ln -s /usr/local/bin/${BCO_MODULE_PREPARE_SCRIPT} && \

# Configure healthcheck
# todo: make sure only device offered by this device manager are checked
HEALTHCHECK --interval=15m --timeout=2m CMD bco-validate >/dev/null || exit 1
HEALTHCHECK --interval=15m --timeout=2m CMD bco-validate --host ${MQTT_BROKER} >/dev/null || exit 1

# switch to root, let the entrypoint drop back to bco user
USER root
Expand Down

0 comments on commit e09d606

Please sign in to comment.