Dockerfile 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. FROM cloudron/base:1.0.0@sha256:147a648a068a2e746644746bbfb42eb7a50d682437cead3c67c933c546357617
  2. # this can be removed in next base image update
  3. RUN apt-get update && \
  4. apt-get install -y php-mbstring php-zip crudini php-soap php-imap zip && \
  5. rm -rf /var/cache/apt /var/lib/apt/lists
  6. RUN mkdir -p /app/code
  7. WORKDIR /app/code
  8. RUN curl -L http://wordpress.org/wordpress-5.2.2.tar.gz | tar -xz --strip-components 1 -f -
  9. RUN rm readme.html wp-admin/install.php wp-config-sample.php
  10. RUN mv /app/code/wp-content /app/code/wp-content-vanilla && ln -s /app/data/wp-content /app/code/wp-content
  11. RUN ln -s /app/data/htaccess /app/code/.htaccess
  12. ADD wp-config.php.template /app/code/wp-config.php.template
  13. RUN ln -sf /run/wordpress/wp-config.php /app/code/wp-config.php
  14. RUN curl -L -o /app/code/wp https://github.com/wp-cli/wp-cli/releases/download/v2.1.0/wp-cli-2.1.0.phar
  15. RUN chmod +x /app/code/wp
  16. RUN /bin/echo -e "apache_modules:\n - mod_rewrite" > /app/code/wp-cli.yml
  17. # Get the plugins
  18. RUN curl -L -o /app/code/authLdap.zip https://github.com/heiglandreas/authLdap/archive/2.3.1.zip
  19. # https://plugins.svn.wordpress.org/disable-wordpress-core-update/
  20. RUN curl -L -o /app/code/disable-wordpress-core-update.zip https://downloads.wordpress.org/plugin/disable-wordpress-core-update.zip
  21. # https://plugins.svn.wordpress.org/wp-mail-smtp/
  22. RUN curl -L -o /app/code/wp-mail-smtp.zip https://downloads.wordpress.org/plugin/wp-mail-smtp.0.10.1.zip
  23. # plugins like duplicator need wp-snapshots folder to be writeable
  24. RUN ln -sf /app/data/wp-snapshots /app/code/wp-snapshots
  25. RUN chown -R www-data:www-data /app/code
  26. # configure apache
  27. RUN rm /etc/apache2/sites-enabled/*
  28. RUN sed -e 's,^ErrorLog.*,ErrorLog "|/bin/cat",' -i /etc/apache2/apache2.conf
  29. COPY apache/mpm_prefork.conf /etc/apache2/mods-available/mpm_prefork.conf.template
  30. RUN ln -sf /run/wordpress/mpm_prefork.conf /etc/apache2/mods-available/mpm_prefork.conf
  31. RUN a2disconf other-vhosts-access-log
  32. ADD apache/wordpress.conf /etc/apache2/sites-enabled/wordpress.conf
  33. RUN echo "Listen 8000" > /etc/apache2/ports.conf
  34. # configure mod_php. apache2ctl -M can be used to list enabled modules
  35. RUN a2enmod rewrite && \
  36. a2enmod expires && \
  37. a2enmod headers && \
  38. a2enmod cache
  39. RUN crudini --set /etc/php/7.2/apache2/php.ini PHP upload_max_filesize 500M && \
  40. crudini --set /etc/php/7.2/apache2/php.ini PHP post_max_size 500M && \
  41. crudini --set /etc/php/7.2/apache2/php.ini PHP max_input_vars 1800 && \
  42. crudini --set /etc/php/7.2/apache2/php.ini opcache opcache.enable 1 && \
  43. crudini --set /etc/php/7.2/apache2/php.ini opcache opcache.enable_cli 1 && \
  44. crudini --set /etc/php/7.2/apache2/php.ini opcache opcache.interned_strings_buffer 8 && \
  45. crudini --set /etc/php/7.2/apache2/php.ini opcache opcache.max_accelerated_files 10000 && \
  46. crudini --set /etc/php/7.2/apache2/php.ini opcache opcache.memory_consumption 128 && \
  47. crudini --set /etc/php/7.2/apache2/php.ini opcache opcache.save_comments 1 && \
  48. crudini --set /etc/php/7.2/apache2/php.ini opcache opcache.revalidate_freq 1 && \
  49. crudini --set /etc/php/7.2/apache2/php.ini Session session.save_path /run/wordpress/sessions && \
  50. crudini --set /etc/php/7.2/apache2/php.ini Session session.gc_probability 1 && \
  51. crudini --set /etc/php/7.2/apache2/php.ini Session session.gc_divisor 100
  52. RUN cp /etc/php/7.2/apache2/php.ini /etc/php/7.2/cli/php.ini
  53. # Hack to stop sendmail/postfix to keep retrying sending emails because of rofs
  54. RUN rm -rf /var/spool
  55. ADD start.sh cron.sh /app/code/
  56. CMD [ "/app/code/start.sh" ]