Feature Request: Healthcheck for newt container #61

Closed
opened 2025-11-19 07:13:04 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @daddeldash on GitHub (Sep 18, 2025).

Hey guys,

as docker has a built in mechanism to restart malfunctioning containers, it could be a good idea to use a healthcheck for the newt containers. Sorry for not directly opening a pull request, but I‘m not very familliar with git and its mechanisms. So here is what I actually use for healthchecks


  newt:
    image: fosrl/newt:latest
    environment:
      - PANGOLIN_ENDPOINT=${NEWT_ENDPOINT}
      - NEWT_ID=${NEWT_ID}
      - NEWT_SECRET=${NEWT_SECRET}
      - DOCKER_SOCKET=/var/run/docker.sock
    healthcheck:
      test:
        - CMD
        - wget
        - --no-verbose
        - --tries=1
        - --spider
        - --quiet
        - ${NEWT_ENDPOINT}
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 30s
      start_interval: 1s
Originally created by @daddeldash on GitHub (Sep 18, 2025). Hey guys, as docker has a built in mechanism to restart malfunctioning containers, it could be a good idea to use a healthcheck for the newt containers. Sorry for not directly opening a pull request, but I‘m not very familliar with git and its mechanisms. So here is what I actually use for healthchecks ``` newt: image: fosrl/newt:latest environment: - PANGOLIN_ENDPOINT=${NEWT_ENDPOINT} - NEWT_ID=${NEWT_ID} - NEWT_SECRET=${NEWT_SECRET} - DOCKER_SOCKET=/var/run/docker.sock healthcheck: test: - CMD - wget - --no-verbose - --tries=1 - --spider - --quiet - ${NEWT_ENDPOINT} interval: 30s timeout: 10s retries: 3 start_period: 30s start_interval: 1s ```
Author
Owner

@oschwartz10612 commented on GitHub (Sep 20, 2025):

We have a health file which I think solves this? We should create an
example maybe!

From the readme:

health-file (optional): Check if connection to WG server (pangolin) is
ok. creates a file if ok, removes it if not ok. Can be used with docker
healtcheck to restart newt

@oschwartz10612 commented on GitHub (Sep 20, 2025): We have a health file which I think solves this? We should create an example maybe! From the readme: health-file (optional): Check if connection to WG server (pangolin) is ok. creates a file if ok, removes it if not ok. Can be used with docker healtcheck to restart newt
Author
Owner

@daddeldash commented on GitHub (Sep 20, 2025):

Sorry, I completely overlooked that point.
Perhaps it would be a good idea to integrate the health check directly into the container via the Dockerfile. Then it would be used automatically.

@daddeldash commented on GitHub (Sep 20, 2025): Sorry, I completely overlooked that point. Perhaps it would be a good idea to integrate the health check directly into the container via the Dockerfile. Then it would be used automatically.
Author
Owner

@jakbutler commented on GitHub (Oct 6, 2025):

Here's an example that worked for me, using the health file:

services:
  newt:
    image: fosrl/newt
    container_name: newt
    volumes:
      - ${CONFIG}/newt:/var/newt #optional, if you want the health file available outside of the container
    environment:
      - PANGOLIN_ENDPOINT=${NEWT_ENDPOINT}
      - NEWT_ID=${NEWT_ID}
      - NEWT_SECRET=${NEWT_SECRET}
      - DOCKER_SOCKET=/var/run/docker.sock
      - HEALTH_FILE=/var/newt/healthy
    healthcheck:
      test: ["CMD-SHELL", "[ -f /var/newt/healthy ]"]
      interval: 30s
      timeout: 5s
      retries: 5
      start_period: 30s
@jakbutler commented on GitHub (Oct 6, 2025): Here's an example that worked for me, using the health file: ```yaml services: newt: image: fosrl/newt container_name: newt volumes: - ${CONFIG}/newt:/var/newt #optional, if you want the health file available outside of the container environment: - PANGOLIN_ENDPOINT=${NEWT_ENDPOINT} - NEWT_ID=${NEWT_ID} - NEWT_SECRET=${NEWT_SECRET} - DOCKER_SOCKET=/var/run/docker.sock - HEALTH_FILE=/var/newt/healthy healthcheck: test: ["CMD-SHELL", "[ -f /var/newt/healthy ]"] interval: 30s timeout: 5s retries: 5 start_period: 30s ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/newt#61