Dockerfile 1.6 KB

1234567891011121314151617181920212223242526272829
  1. FROM debian:stretch
  2. RUN apt update
  3. RUN apt install -y git autoconf automake build-essential libgpac-dev libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev pkg-config texi2html zlib1g-dev wget yasm libdvdnav4 libdvdread4 libvpx. libx264. libpcre3 libpcre3-dev libssl-dev unzip nano htop cron
  4. ENV TZ=Europe/Madrid
  5. RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
  6. RUN mkdir -p /builder/ffmpeg /hls /save /var/log/nginx/ && chmod -R 777 /hls
  7. COPY ./conf/clear.sh /hls
  8. RUN chmod +x /hls/clear.sh
  9. COPY ./conf/crontab /etc/cron.d/clear-task
  10. RUN chmod 0644 /etc/cron.d/clear-task
  11. RUN crontab /etc/cron.d/clear-task
  12. RUN wget https://ffmpeg.org/releases/ffmpeg-4.1.3.tar.bz2 -O /builder/ffmpeg.tar.bz2
  13. RUN wget https://nginx.org/download/nginx-1.14.2.tar.gz -O /builder/nginx.tar.gz
  14. RUN wget https://github.com/arut/nginx-rtmp-module/archive/master.zip -O /builder/rtmp_nginx.zip
  15. RUN cd /builder && tar -zxvf nginx.tar.gz && unzip rtmp_nginx.zip && ls
  16. RUN cd /builder/nginx-1.14.2/ && ./configure --add-module=../nginx-rtmp-module-master
  17. RUN cd /builder/nginx-1.14.2/ && make -j12
  18. RUN cd /builder/nginx-1.14.2/ && make install
  19. RUN tar xjf /builder/ffmpeg.tar.bz2 -C /builder/ffmpeg --strip-components=1
  20. WORKDIR /builder/ffmpeg
  21. RUN ./configure --enable-nonfree --enable-libx264 --enable-gpl
  22. RUN make -j12; make install
  23. COPY ./conf/nginx.conf /usr/local/nginx/conf
  24. COPY ./conf/hls.sh /opt/
  25. RUN chmod +x /opt/hls.sh
  26. WORKDIR /usr/local/nginx/sbin
  27. CMD ["/usr/local/nginx/sbin/nginx", "-g", "daemon off;"]
  28. RUN cron
  29. RUN crontab -l