diff --git a/Dockerfile b/Dockerfile index 8353adb..37cc8a5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -56,7 +56,7 @@ EXPOSE 79 # Add health check HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ - CMD nc -z localhost 79 || exit 1 + CMD nc -w 1 127.0.0.1 79 < /dev/null || exit 1 # Set metadata labels LABEL org.opencontainers.image.title="finger" diff --git a/docker-compose.yml b/docker-compose.yml index 7bade87..2e6ba5d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,7 +9,7 @@ services: - ./users:/var/finger/users restart: unless-stopped healthcheck: - test: ["CMD", "nc", "-z", "localhost", "79"] + test: ["CMD-SHELL", "nc -w 1 127.0.0.1 79 < /dev/null || exit 1"] interval: 30s timeout: 10s retries: 3