diff --git a/Dockerfile b/Dockerfile index 3545da9..15495be 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 && \ diff --git a/clean.sh b/clean.sh new file mode 100755 index 0000000..ceff161 --- /dev/null +++ b/clean.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +HLS=/var/www/html/canal/ +find $HLS -type f -name "*.ts" -amin +30 -exec rm {} \;