Dockerfile 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 /run/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. # copy website code mind the trailing slash to copy its content to /app/code/ not the folder itself
  25. ADD website/ /app/code/
  26. # copy app code
  27. ADD app /app/code/app
  28. RUN chown -R www-data.www-data /app/code
  29. ADD start.sh /app/pkg/
  30. # RUN sed -i "s/\$host = \".*\";/\$host = \$_ENV[\"MYSQL_HOST\"];/" /app/code/DataBase/database.php
  31. # RUN sed -i "s/\$user = \".*\";/\$user = \$_ENV[\"MYSQL_USERNAME\"];/" /app/code/DataBase/database.php
  32. # RUN sed -i "s/\$password = \".*\";/\$password = \$_ENV[\"MYSQL_PASSWORD\"];/" /app/code/DataBase/database.php
  33. # RUN sed -i "s/\$db = \".*\";/\$db = \$_ENV[\"MYSQL_DATABASE\"];/" /app/code/DataBase/database.php
  34. CMD [ "/app/pkg/start.sh" ]