m0ngr31 / EPlusTV

Virtual linear channels for ESPN, ESPN+, MSG+, NFL+, B1G+, NESN, Mountain West, FloSports, Paramount+, MLB.tv, and FOX Sports
MIT License
133 stars 23 forks source link

Added server port env variable #2

Closed reeseovine closed 3 years ago

reeseovine commented 3 years ago

Allows you to specify a custom port on the docker container (it would be the right-hand-side of the port mapping). I needed this because I want to route this container's traffic through gluetun and port 8000 is already taken.

m0ngr31 commented 3 years ago

I think the "docker" way of doing this would to just map the port at runtime: docker run ... -p 8080:8000 m0ngr31/eplustv

reeseovine commented 3 years ago

Well like I said, I needed this for Gluetun which is a VPN routing container. How it works is you add network_mode: 'service:gluetun' to the containers you want to route through it and then map the ports you want accessible locally in the Gluetun container, so it basically acts as a proxy for local ports. Because port 8000 is already taken by the Gluetun web interface, my instance of EPlusTV needs a different port. Here's the relevant parts of my compose file:

  gluetun:
    image: qmcgaw/gluetun
    container_name: gluetun
    ports:
      - 8420:8000 # Web interface
      - 8421:8888 # HTTP proxy
      - 9117:9117
      - 8112:8112
      - 58846:58846/tcp
      - 8666:8666
      - 3776:3776 # EPlusTV

  eplustv:
    image: katacarbix/eplustv
    environment:
      - "ACCESS_URI='http://192.168.0.20:3776'"
      - "PORT=3776"
      - "ESPN_USER=${ESPN_USER}"
      - "ESPN_PASS=${ESPN_PASS}"
      - "START_CHANNEL=200"
    network_mode: 'service:gluetun'

It's a weird situation that I don't think many others would have but it's something I personally needed. If you don't want to merge it that's fine, I can just maintain my own fork with this feature. 🚀

reeseovine commented 3 years ago

Oh wait, I just found out I can change Gluetun's web interface port so maybe this isn't an issue like I thought it was ¯\_(ツ)_/¯