diff --git a/portainer_agent/Dockerfile b/portainer_agent/Dockerfile index 74686a69d..4472d26cb 100644 --- a/portainer_agent/Dockerfile +++ b/portainer_agent/Dockerfile @@ -75,10 +75,7 @@ RUN if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get # 4 Entrypoint # ################ -RUN chmod a+x /usr/sbin/healthcheck && \ - chmod a+x /usr/sbin/wait-for-signal - -WORKDIR [ "/app" ] +WORKDIR "/app" ENTRYPOINT [ "/init" ] ############ @@ -115,4 +112,11 @@ LABEL \ # 6 Healthcheck # ################# -HEALTHCHECK --interval=10s --timeout=5s --retries=3 CMD healthcheck +ENV HEALTH_PORT="9000" \ + HEALTH_URL="/api/system/status" +HEALTHCHECK \ + --interval=5s \ + --retries=5 \ + --start-period=30s \ + --timeout=25s \ + CMD curl --fail "http://127.0.0.1:${HEALTH_PORT}${HEALTH_URL}" &>/dev/null || exit 1 diff --git a/portainer_agent/rootfs/etc/cont-init.d/99-run.sh b/portainer_agent/rootfs/etc/cont-init.d/99-run.sh index 6c7b95d04..1b9014b24 100755 --- a/portainer_agent/rootfs/etc/cont-init.d/99-run.sh +++ b/portainer_agent/rootfs/etc/cont-init.d/99-run.sh @@ -9,4 +9,5 @@ bashio::require.unprotected # Set environemnt # Launch app +cd /app || true ./agent "$PORTAINER_AGENT_ARGS"