Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After 3 days the mirror breaks down. So here is a helper for anyone encountering the same issue., #6

Open
cocoonkid opened this issue Jun 12, 2024 · 0 comments

Comments

@cocoonkid
Copy link

cocoonkid commented Jun 12, 2024

After 3 days the mirror breaks down. So here is a helper for anyone encountering the same issue.

I haven't got time to research the underlying issue, but this way it happily mirrors away for me, for 36days and counting.

This basically restarts the mirror container once every 24hrs.

services:
  mqtt_mirror:
    container_name: mqtt-mirror
    restart: unless-stopped
    image: antegulin/mqtt-mirror
    command: ./mqtt-mirror --source tcp://host.docker.internal:1883  --target tcp:/<target>:1883
    extra_hosts:
      - "host.docker.internal:host-gateway"


  restarter:
    container_name: restarter
    image: docker:cli
    volumes: ["/var/run/docker.sock:/var/run/docker.sock"]
    command: /bin/sh -c "while true; do sleep 86400; docker restart mqtt-mirror && echo \"mqtt-mirror restarted at \$(date)\"; done"
    ports: []
    restart: unless-stopped
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant