Dockerfile 1.6 KB

123456789101112131415161718192021222324252627282930313233343536
  1. FROM cloudron/base:2.0.0@sha256:f9fea80513aa7c92fe2e7bf3978b54c8ac5222f47a9a32a7f8833edf0eb5a4f4
  2. RUN mkdir -p /app/code /app/pkg
  3. WORKDIR /app/code
  4. # configure apache
  5. RUN rm /etc/apache2/sites-enabled/*
  6. RUN sed -e 's,^ErrorLog.*,ErrorLog "|/bin/cat",' -i /etc/apache2/apache2.conf
  7. COPY apache/mpm_prefork.conf /etc/apache2/mods-available/mpm_prefork.conf
  8. COPY apache/lamp.conf /etc/apache2/sites-enabled/lamp.conf
  9. RUN echo "Listen 80" > /etc/apache2/ports.conf
  10. RUN a2disconf other-vhosts-access-log
  11. RUN a2enmod rewrite headers rewrite expires cache
  12. # configure mod_php
  13. # default_charset is set due to https://www.saotn.org/php-56-default_charset-change-may-break-html-output/
  14. RUN crudini --set /etc/php/7.3/apache2/php.ini PHP upload_max_filesize 64M && \
  15. crudini --set /etc/php/7.3/apache2/php.ini PHP post_max_size 64M && \
  16. crudini --set /etc/php/7.3/apache2/php.ini PHP memory_limit 128M && \
  17. crudini --set /etc/php/7.3/apache2/php.ini Session session.save_path /tmp/sessions && \
  18. crudini --set /etc/php/7.3/apache2/php.ini Session session.gc_probability 1 && \
  19. crudini --set /etc/php/7.3/apache2/php.ini Session session.gc_divisor 100 && \
  20. crudini --set /etc/php/7.3/apache2/php.ini PHP default_charset ""
  21. # supervisor# configure supervisor
  22. ADD supervisor/ /etc/supervisor/conf.d/
  23. RUN sed -e 's,^logfile=.*$,logfile=/run/supervisord.log,' -i /etc/supervisor/supervisord.conf
  24. ADD start.sh /app/pkg/
  25. # copy website code mind the trailing slash to copy its content to /app/code/ not the folder itself
  26. ADD website/ /app/code/
  27. RUN chown -R www-data.www-data /app/code
  28. CMD [ "/app/pkg/start.sh" ]