update Dockerfile to match directories in the container for COPY, more appropriate file placement

This commit is contained in:
Nic D 2026-03-10 10:53:35 -04:00
parent d502fa5585
commit 105b70b2df
3 changed files with 12 additions and 14 deletions

View File

@ -1,18 +1,16 @@
FROM debian:12-slim FROM debian:12
# Install wget and xmlstarlet, an optimized xml parser. Then clear apt cache # Install wget and xmlstarlet, an optimized xml parser. Then clear apt cache
RUN apt update && apt install -y --no-install-recommends \ RUN apt update && apt install -y --no-install-recommends bash wget xmlstarlet cron
bash \
wget \
xmlstarlet \
cron
# Copy channel id list to data directory, cleaner script to opt directory # Copy channel id list to data directory, cleaner script to opt directory
COPY xml_tv_ids.txt /data/ COPY channel_keep_list.txt /opt/channel_keep_list.txt
COPY xml_cleaner.sh /opt/ COPY channels_translate.txt /opt/channels_translate.txt
COPY tmpl.xsl /opt/tmpl.xsl
COPY xml_cleaner_v3.sh /opt/xml_cleaner.sh
# Add the cron job # Add the cron job
RUN echo "0 3 * * * /opt/xml_cleaner.sh" > /etc/cron.d/cleaner-cron-job RUN echo "0 7 * * * /opt/xml_cleaner.sh" > /etc/cron.d/cleaner-cron-job
RUN chmod 0644 /etc/cron.d/cleaner-cron-job RUN chmod 0644 /etc/cron.d/cleaner-cron-job
CMD ["cron", "-f"] CMD ["cron", "-f"]

View File

@ -8,7 +8,7 @@
<xsl:apply-templates select="@*|node()" /> <xsl:apply-templates select="@*|node()" />
</xsl:copy> </xsl:copy>
</xsl:template> </xsl:template>
0
<!-- Special handling for programme --> <!-- Special handling for programme -->
<xsl:template match="programme"> <xsl:template match="programme">
<xsl:copy> <xsl:copy>
@ -62,7 +62,7 @@
select="node()[not(self::episode-num[@system='onscreen'])]" /> select="node()[not(self::episode-num[@system='onscreen'])]" />
<!-- Add the onscreen one at the end if the numbers actually exist --> <!-- Add the onscreen one at the end if the numbers actually exist -->
<xsl:if test="$s2 &gte; 0 and $e2 &gte; 0"> <xsl:if test="$s2 &gt;= 0 and $e2 &gt;= 0">
<episode-num system="onscreen"> <episode-num system="onscreen">
<xsl:value-of select="$onscreenValue"/> <xsl:value-of select="$onscreenValue"/>
</episode-num> </episode-num>

View File

@ -2,7 +2,7 @@
wget "ftp://uptele:JCtHc3mQ866QL8rd@ftp.tvmedia.ca/xmltv.xml" -O /data/xmltv.xml wget "ftp://uptele:JCtHc3mQ866QL8rd@ftp.tvmedia.ca/xmltv.xml" -O /data/xmltv.xml
id_list="/data/channel_keep_list.txt" id_list="/opt/channel_keep_list.txt"
raw="/data/xmltv.xml" raw="/data/xmltv.xml"
parse_output="/data/parsed_new_epg.xml" parse_output="/data/parsed_new_epg.xml"
update_output="/data/updated_new_epg.xml" update_output="/data/updated_new_epg.xml"
@ -37,7 +37,7 @@ while read LINE; do
awk -v old="$OLD_CHANNEL_ID" -v new="$NEW_CHANNEL_ID" '{gsub(old, new); print}' /tmp/tmpxmltv.xml >> /tmp/newtmpxmltv.xml awk -v old="$OLD_CHANNEL_ID" -v new="$NEW_CHANNEL_ID" '{gsub(old, new); print}' /tmp/tmpxmltv.xml >> /tmp/newtmpxmltv.xml
rm /tmp/tmpxmltv.xml rm /tmp/tmpxmltv.xml
mv /tmp/newtmpxmltv.xml /tmp/tmpxmltv.xml mv /tmp/newtmpxmltv.xml /tmp/tmpxmltv.xml
done < channels_translate.txt done < /opt/channels_translate.txt
mv /tmp/tmpxmltv.xml $update_output mv /tmp/tmpxmltv.xml $update_output