Streamrecord in a container
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

29 lines
1.3 KiB

  1. FROM ubuntu:eoan
  2. # Create user
  3. RUN useradd --create-home --uid 1000 streamrecord && \
  4. echo "streamrecord:streamrecord" | chpasswd && \
  5. apt-get update && apt-get install -y vim nginx-full uwsgi uwsgi-plugin-python3 python3-cherrypy3 python3-jinja2 supervisor curl mkvtoolnix ffmpeg cron && \
  6. echo "daemon off;" >> /etc/nginx/nginx.conf && \
  7. echo "* * * * * sleep 2 && curl -s http://127.0.0.1/api/tick > /dev/null" > /tmp/crontab && \
  8. crontab -u streamrecord /tmp/crontab && \
  9. rm /tmp/crontab && \
  10. su -c "mkdir /home/streamrecord/app/" streamrecord
  11. # install configs
  12. COPY default /etc/nginx/sites-available/default
  13. COPY streamrecord.ini /etc/uwsgi/apps-enabled/streamrecord.ini
  14. COPY nginx.conf /etc/supervisor/conf.d/nginx.conf
  15. COPY cron.conf /etc/supervisor/conf.d/cron.conf
  16. COPY streamrecord.conf /etc/supervisor/conf.d/streamrecord.conf
  17. COPY supervisor.conf /etc/supervisor/conf.d/supervisor.conf
  18. # Install python app code
  19. COPY streamrecord/ /home/streamrecord/app/
  20. RUN chown -R streamrecord /home/streamrecord/app && \
  21. su -c "mkdir /home/streamrecord/app/files /home/streamrecord/app/files/output /home/streamrecord/app/files/temp /home/streamrecord/app/sessions && ln -s ../files/output /home/streamrecord/app/static/output" streamrecord && \
  22. rm -rf /etc/cron*
  23. EXPOSE 80
  24. ENTRYPOINT ["supervisord"]