version: "3"
services:
  tvheadend_nm3u8dl:
    image: lscr.io/linuxserver/tvheadend:latest
    container_name: tvheadend_nm3u8dl
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Madrid
    volumes:
      - ./config:/config
      - ./recordings:/recordings
      - ./channels:/opt/channels
      - ./epggrabber/tv_grab_EPG_dobleM:/usr/bin/tv_grab_EPG_dobleM
    ports:
      - 9981:9981
      - 9982:9982
    restart: unless-stopped
    networks:
      - tvheadend_nm3u8dl

  tvhproxy_nm3u8dl:
    build: tvhProxy
    container_name: tvhproxy_nm3u8dl
    ports:
      - 5004:5004
    environment:
      - TVH_URL=${TVH_URL}
      - TVH_TUNER_COUNT=${TVH_TUNER_COUNT}
      - TVH_PROXY_HOST=${TVH_PROXY_HOST}
    restart: unless-stopped
    networks:
      - tvheadend_nm3u8dl

  tvh_server_nm3u8dl:
    build: server_nm3u8dl
    image: tvh_server_nm3u8dl
    container_name: tvh_server_nm3u8dl
    tmpfs:
      - /tmp/ramdisk:size=500M
    volumes:
      - ./channels/channels.json:/app/channels.json
    restart: unless-stopped
    networks:
      - tvheadend_nm3u8dl

networks:
  tvheadend_nm3u8dl:
    name: tvheadend_nm3u8dl
