Update: Clean files every hour

This commit is contained in:
Siroco 2023-05-08 14:38:26 -05:00
parent 706993bc93
commit a436751bf3
No known key found for this signature in database
GPG Key ID: 1324098302A514B0
2 changed files with 9 additions and 1 deletions

View File

@ -1,6 +1,7 @@
FROM registry.sindominio.net/nginx
RUN apt-get update && apt-get install -y libnginx-mod-rtmp && apt-get clean
RUN apt-get update -y && \
apt-get install -y libnginx-mod-rtmp cron
RUN rm -rf /var/www/html/*
@ -8,6 +9,9 @@ RUN rm -rf /var/www/html/*
WORKDIR /tmp/
COPY nginx-rtmp.conf /tmp/
RUN cat /tmp/nginx-rtmp.conf >> /etc/nginx/nginx.conf
RUN rm -rf /tmp/*
ADD clean.sh /etc/cron.hourly/
RUN mkdir -p /var/www/html/hls && \
chmod 777 /var/www/html/hls && \

4
clean.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
HLS=/var/www/html/canal/
find $HLS -type f -name "*.ts" -amin +30 -exec rm {} \;