Make HTTP port configurable with default 1876
Build and Publish TVJ EPG Image / build (push) Successful in 24s
Build and Publish TVJ EPG Image / build (push) Successful in 24s
This commit is contained in:
+2
-2
@@ -5,8 +5,8 @@ COPY epg ./epg
|
|||||||
COPY tvj_epj.py .
|
COPY tvj_epj.py .
|
||||||
RUN pip install --no-cache-dir requests
|
RUN pip install --no-cache-dir requests
|
||||||
|
|
||||||
ENV UPDATE_INTERVAL=6
|
ENV UPDATE_INTERVAL=6 PORT=1876
|
||||||
EXPOSE 8787
|
EXPOSE 1876
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
RUN chmod +x /entrypoint.sh
|
RUN chmod +x /entrypoint.sh
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ Build this checkout and select both channels:
|
|||||||
|
|
||||||
```sh
|
```sh
|
||||||
podman build -t tvj-epg .
|
podman build -t tvj-epg .
|
||||||
podman run -d --name tvj-epg -p 8787:8787 \
|
podman run -d --name tvj-epg -p 1876:1876 \
|
||||||
-e TZ=America/Jamaica \
|
-e TZ=America/Jamaica \
|
||||||
-e CHANNELS=tvj,tvjsn \
|
-e CHANNELS=tvj,tvjsn \
|
||||||
-e UPDATE_INTERVAL=3 \
|
-e UPDATE_INTERVAL=3 \
|
||||||
@@ -20,8 +20,12 @@ podman run -d --name tvj-epg -p 8787:8787 \
|
|||||||
With no `CHANNELS` setting, only TVJ is included, preserving the default behavior.
|
With no `CHANNELS` setting, only TVJ is included, preserving the default behavior.
|
||||||
Use `CHANNELS=tvjsn` for TVJ Sports Network alone.
|
Use `CHANNELS=tvjsn` for TVJ Sports Network alone.
|
||||||
|
|
||||||
- Playlist: `http://localhost:8787/tvj.m3u`
|
- Playlist: `http://localhost:1876/tvj.m3u`
|
||||||
- Guide: `http://localhost:8787/tvj.xml`
|
- Guide: `http://localhost:1876/tvj.xml`
|
||||||
|
|
||||||
|
To use a different port, set `PORT` and match the container port in the mapping,
|
||||||
|
for example `-e PORT=8787 -p 8787:8787`. Recreating an existing container requires
|
||||||
|
updating its port mapping for the new default.
|
||||||
|
|
||||||
Both files contain the selected channels. Their XMLTV IDs and playlist `tvg-id`
|
Both files contain the selected channels. Their XMLTV IDs and playlist `tvg-id`
|
||||||
values match automatically. Outputs become available after the first successful
|
values match automatically. Outputs become available after the first successful
|
||||||
@@ -31,6 +35,7 @@ update. Stream access is determined by the stream provider.
|
|||||||
|
|
||||||
| Variable | Default | Meaning |
|
| Variable | Default | Meaning |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
|
| `PORT` | `1876` | HTTP listening port (1–65535) |
|
||||||
| `CHANNELS` | `tvj` | Comma-separated built-in channel keys; unknown keys fail startup |
|
| `CHANNELS` | `tvj` | Comma-separated built-in channel keys; unknown keys fail startup |
|
||||||
| `UPDATE_INTERVAL` | `6` | Positive integer refresh interval in hours |
|
| `UPDATE_INTERVAL` | `6` | Positive integer refresh interval in hours |
|
||||||
| `TZ` | Container timezone | Logging timezone; XMLTV timestamps remain UTC |
|
| `TZ` | Container timezone | Logging timezone; XMLTV timestamps remain UTC |
|
||||||
|
|||||||
+5
-1
@@ -1,6 +1,10 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
|
PORT="${PORT-1876}"
|
||||||
|
export PORT
|
||||||
|
PORT="$(python -c 'import os; value = os.environ["PORT"]; valid = value.isascii() and value.isdigit() and 1 <= int(value) <= 65535; valid or exit("PORT must be an integer from 1 to 65535"); print(int(value))')"
|
||||||
|
|
||||||
mkdir -p /app/output
|
mkdir -p /app/output
|
||||||
UPDATE_INTERVAL="${UPDATE_INTERVAL:-6}"
|
UPDATE_INTERVAL="${UPDATE_INTERVAL:-6}"
|
||||||
export UPDATE_INTERVAL
|
export UPDATE_INTERVAL
|
||||||
@@ -18,4 +22,4 @@ python -c 'from epg.config import load; load()'
|
|||||||
) &
|
) &
|
||||||
|
|
||||||
cd /app/output
|
cd /app/output
|
||||||
exec python3 -m http.server 8787
|
exec python3 -m http.server "$PORT"
|
||||||
|
|||||||
Reference in New Issue
Block a user