Dockerfile 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. FROM phusion/baseimage:0.11
  2. MAINTAINER nando
  3. # Set correct environment variables
  4. ENV DEBIAN_FRONTEND noninteractive
  5. ENV HOME /root
  6. ENV LC_ALL C.UTF-8
  7. ENV LANG en_US.UTF-8
  8. ENV LANGUAGE en_US.UTF-8
  9. ENV TERM xterm
  10. # Use baseimage-docker's init system
  11. CMD ["/sbin/my_init"]
  12. # Configure user nobody to match unRAID's settings
  13. RUN \
  14. usermod -u 99 nobody && \
  15. usermod -g 100 nobody && \
  16. usermod -d /home nobody && \
  17. chown -R nobody:users /home
  18. RUN apt-get update
  19. RUN add-apt-repository ppa:ondrej/php
  20. RUN apt-get update
  21. RUN apt-get upgrade -y
  22. RUN apt-get install -y mc
  23. RUN apt-get install -y tmux
  24. RUN apt-get install -y php7.1-mysql
  25. RUN apt-get install -y php7.1-mysqlnd
  26. # Install proxy Dependencies
  27. RUN apt-get update -y
  28. RUN apt-get install -y apache2
  29. RUN apt-get install -y php7.1 libapache2-mod-php7.1 php7.1-mcrypt php7.1-cli php7.1-xml php7.1-zip \
  30. php7.1-mysql php7.1-gd php7.1-imagick php7.1-recode php7.1-tidy php7.1-xmlrpc \
  31. php-curl php7.1-mbstring php7.1-soap php7.1-intl php7.1-ldap php7.1-imap php-xml \
  32. php7.1-sqlite php7.1-mcrypt inotify-tools php7.1-common
  33. RUN apt-get clean -y
  34. RUN rm -rf /var/lib/apt/lists/*
  35. RUN \
  36. service apache2 restart && \
  37. rm -R -f /var/www && \
  38. ln -s /web /var/www
  39. # Update apache configuration with this one
  40. RUN \
  41. mv /etc/apache2/sites-available/000-default.conf /etc/apache2/000-default.conf && \
  42. rm /etc/apache2/sites-available/* && \
  43. rm /etc/apache2/apache2.conf && \
  44. ln -s /config/proxy-config.conf /etc/apache2/sites-available/000-default.conf && \
  45. ln -s /var/log/apache2 /logs
  46. ADD proxy-config.conf /etc/apache2/000-default.conf
  47. ADD apache2.conf /etc/apache2/apache2.conf
  48. ADD ports.conf /etc/apache2/ports.conf
  49. # Manually set the apache environment variables in order to get apache to work immediately.
  50. RUN \
  51. echo www-data > /etc/container_environment/APACHE_RUN_USER && \
  52. echo www-data > /etc/container_environment/APACHE_RUN_GROUP && \
  53. echo /var/log/apache2 > /etc/container_environment/APACHE_LOG_DIR && \
  54. echo /var/lock/apache2 > /etc/container_environment/APACHE_LOCK_DIR && \
  55. echo /var/run/apache2.pid > /etc/container_environment/APACHE_PID_FILE && \
  56. echo /var/run/apache2 > /etc/container_environment/APACHE_RUN_DIR
  57. # Expose Ports
  58. EXPOSE 80 443
  59. # The www directory and proxy config location
  60. VOLUME ["/config", "/web", "/logs"]
  61. # Add our crontab file
  62. ADD crons.conf /root/crons.conf
  63. # Add firstrun.sh to execute during container startup
  64. ADD firstrun.sh /etc/my_init.d/firstrun.sh
  65. RUN chmod +x /etc/my_init.d/firstrun.sh
  66. # Add inotify.sh to execute during container startup
  67. RUN mkdir /etc/service/inotify
  68. ADD inotify.sh /etc/service/inotify/run
  69. RUN chmod +x /etc/service/inotify/run
  70. # Add apache to runit
  71. RUN mkdir /etc/service/apache
  72. ADD apache-run.sh /etc/service/apache/run
  73. RUN chmod +x /etc/service/apache/run
  74. ADD apache-finish.sh /etc/service/apache/finish
  75. RUN chmod +x /etc/service/apache/finish
  76. RUN a2enmod rewrite