hardillb / nginx-proxy-avahi-helper

A container to generate matching mDNS CNAMEs for the virtual hosts used by jwilder/nginx-proxy
https://www.hardill.me.uk/wordpress/2020/09/22/nginx-proxy-avahi-helper/
Apache License 2.0
15 stars 2 forks source link

Is the container supposed to immediately quit? #6

Closed crashfrog closed 1 year ago

crashfrog commented 1 year ago

I'm attempting to use this to organize services on my home server, but when I run the container:

2023-02-27 14:49:19 forego     | starting dockergen.1 on port 5000
2023-02-27 14:49:19 forego     | starting cname.1 on port 5100
2023-02-27 14:49:19 cname.1    | Traceback (most recent call last):
2023-02-27 14:49:19 forego     | starting cname.1 on port 5200
2023-02-27 14:49:19 forego     | sending SIGTERM to dockergen.1
2023-02-27 14:49:19 forego     | sending SIGTERM to cname.1
hardillb commented 1 year ago

No, but without knowing a lot more about how you are running things really can't say anything more

crashfrog commented 1 year ago

Sure, that's fair. First I just wanted a basic sanity check about how the container was meant to function, so thank you for getting back to me, I really appreciate it. Let me describe my setup a bit more:

1) This is a Mac M1 Mini, using Docker Desktop (v. 20.10.22, build 3a2c30b) and a docker-compose file to wrangle a couple of services. They all have web UI's on different ports.

2) Here's the relevant sections of my docker-compose:

version: "2.1"
services:
  avahi-helper:
    image: hardillb/nginx-proxy-avahi-helper:latest
    container_name: avahi-helper
    network_mode: host
    volumes:
      - /run/dbus/system_bus_socket:/run/dbus/system_bus_socket
      - /var/run/docker.sock:/tmp/docker.sock
  resilio-sync:
    image: lscr.io/linuxserver/resilio-sync:latest
    container_name: resilio-sync
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=ICT
      - VIRTUAL_HOST=sync.feste.local
      - VIRTUAL_PORT=8888
    volumes:
      - $PWD/.sync:/config
      - $HOME/Downloads:/downloads
      - /Volumes/BKUP/sync:/sync
    ports:
      - 8888:8888
      - 55554:55555
    restart: unless-stopped
    depends_on:
        avahi-helper:
          condition: service_started

I'm not a Docker expert, so that's based on documentation from linuxserver.io and my best guess from the nginx-proxy-avahi-helper examples. Whether I start the container using docker-compose or directly at the command line, it immediately terminates. Inspecting the container logs gives the above output (immediate SIGTERM to dockergen and cname.)

Thank you for the time you've already spent and please accept my gratitude for any assistance you feel you can provide. I appreciate that this is probably a side project for you; if there's an alternative way to get CNAMEs to work in Avahi/mDNS in Docker you'd like to direct me to I'd be happy to pursue that, instead.

hardillb commented 1 year ago

The host OS will need to be Linux, it will not work with macOS

hardillb commented 1 year ago

Just to be clear here: