Dockerfile 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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 add-apt-repository ppa:ondrej/php
  19. RUN apt-get update
  20. RUN apt-get upgrade -y
  21. RUN apt-get install -y mc tmux wget
  22. # Install proxy Dependencies
  23. RUN apt-get install -y apache2
  24. RUN apt-get install -y php7.1 libapache2-mod-php7.1 php7.1-mcrypt php7.1-cli php7.1-xml php7.1-zip \
  25. php7.1-mysql php7.1-mysqlnd php7.1-gd php7.1-imagick php7.1-recode php7.1-tidy \
  26. php-curl php7.1-mbstring php7.1-soap php7.1-intl php7.1-ldap php7.1-imap php-xml \
  27. php7.1-sqlite php7.1-mcrypt php7.1-common php7.1-xmlrpc inotify-tools
  28. RUN apt-get clean -y
  29. RUN rm -rf /var/lib/apt/lists/*
  30. RUN \
  31. service apache2 restart && \
  32. rm -R -f /var/www && \
  33. ln -s /web /var/www
  34. RUN \
  35. #mv /etc/apache2/sites-available/000-default.conf /etc/apache2/000-default.conf && \
  36. rm /etc/apache2/sites-available/000-default.conf && \
  37. rm /etc/apache2/sites-available/* && \
  38. rm /etc/apache2/apache2.conf && \
  39. ln -s /config/proxy-config.conf /etc/apache2/sites-available/000-default.conf && \
  40. ln -s /var/log/apache2 /logs
  41. ADD apache2.conf /etc/apache2/apache2.conf
  42. ADD proxy-config.conf /etc/apache2/000-default.conf
  43. ADD ports.conf /etc/apache2/ports.conf
  44. # Manually set the apache environment variables in order to get apache to work immediately.
  45. RUN \
  46. echo www-data > /etc/container_environment/APACHE_RUN_USER && \
  47. echo www-data > /etc/container_environment/APACHE_RUN_GROUP && \
  48. echo /var/log/apache2 > /etc/container_environment/APACHE_LOG_DIR && \
  49. echo /var/lock/apache2 > /etc/container_environment/APACHE_LOCK_DIR && \
  50. echo /var/run/apache2.pid > /etc/container_environment/APACHE_PID_FILE && \
  51. echo /var/run/apache2 > /etc/container_environment/APACHE_RUN_DIR
  52. # Expose Ports
  53. EXPOSE 80 443
  54. # The www directory and proxy config location
  55. VOLUME ["/config", "/web", "/logs"]
  56. # Add our crontab file
  57. ADD crons.conf /root/crons.conf
  58. # Add firstrun.sh to execute during container startup
  59. ADD firstrun.sh /etc/my_init.d/firstrun.sh
  60. RUN chmod +x /etc/my_init.d/firstrun.sh
  61. # Add inotify.sh to execute during container startup
  62. RUN mkdir /etc/service/inotify
  63. ADD inotify.sh /etc/service/inotify/run
  64. RUN chmod +x /etc/service/inotify/run
  65. # Add apache to runit
  66. RUN mkdir /etc/service/apache
  67. ADD apache-run.sh /etc/service/apache/run
  68. RUN chmod +x /etc/service/apache/run
  69. ADD apache-finish.sh /etc/service/apache/finish
  70. RUN chmod +x /etc/service/apache/finish
  71. RUN a2enmod rewrite