Version personnelle de php:7.4-apache pour arm64
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
2.3 KiB

1 month ago
3 years ago
3 years ago
3 years ago
3 years ago
1 month ago
3 years ago
3 years ago
3 years ago
2 years ago
  1. FROM "php:7.4-apache"
  2. LABEL maintainer="Julien Cabillot <dockerimages@cabillot.eu>"
  3. RUN export DEBIAN_FRONTEND="noninteractive" && \
  4. sed -i'' 's/ServerSignature On/ServerSignature Off/; s/ServerTokens OS/ServerTokens Prod/' "/etc/apache2/conf-enabled/security.conf" && \
  5. sed -i'' 's/^Listen 80$/Listen 8080/' "/etc/apache2/ports.conf" && \
  6. sed -i'' 's/^<VirtualHost \*:80>$/<VirtualHost *:8080>/' '/etc/apache2/sites-enabled/000-default.conf' && \
  7. echo "RemoteIPHeader X-Forwarded-For\nRemoteIPProxiesHeader X-Forwarded-By" > "${APACHE_CONFDIR}/conf-available/remoteip.conf" && \
  8. sed -i'' 's/\(LogFormat "%h.*combined\)/LogFormat "%a %l %u %t \\"%r\\" %>s %O \\"%{Referer}i\\" \\"%{User-Agent}i\\"" combined/' "${APACHE_CONFDIR}/apache2.conf" && \
  9. a2enconf remoteip && \
  10. a2enmod remoteip headers rewrite && \
  11. apt-get -qq --yes autoremove --purge && \
  12. apt-get -qq --yes clean all && \
  13. # Ici je ne supprime pas /usr/src car utilisé par les sous projets (docker php
  14. rm -rf "/usr/share/doc/"* \
  15. "/var/cache/"* \
  16. "/var/lib/apt/lists/"* \
  17. "/var/cache/"* \
  18. "/var/log/"{apt/*,dpkg.log} \
  19. "/var/www/html" \
  20. "/tmp/"* && \
  21. install --directory --group="www-data" --owner="www-data" --mode="2770" "/var/www/html" && \
  22. # On active les logs sur stderr (apache + php)
  23. sed -ri 's#^(\s*ErrorLog)\s+\S+#\1 /proc/self/fd/2#g;' "/etc/apache2/apache2.conf" && \
  24. sed -ri ' \
  25. s#^(\s*CustomLog)\s+\S+#\1 /proc/self/fd/1#g; \
  26. s#^(\s*ErrorLog)\s+\S+#\1 /proc/self/fd/2#g; \
  27. ' "/etc/apache2/sites-enabled/000-default.conf" && \
  28. echo "error_reporting=E_ALL\nerror_log=/proc/self/fd/2\nlog_errors=On\nexpose_php=Off" > "/usr/local/etc/php/conf.d/override.ini"
  29. # Add Tini
  30. ENV "TINI_VERSION" "v0.19.0"
  31. ADD "https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini" "/tini"
  32. RUN chmod +x "/tini"
  33. # TODO: actuellement tiny fout completement la merde
  34. # TODO: on remets pour tester
  35. ENTRYPOINT ["/tini", "--"]
  36. CMD [ "docker-php-entrypoint", "apache2-foreground" ]
  37. # C'est dommage mais il n'est pas possible de faire unexpose :
  38. # https://github.com/moby/moby/issues/3465
  39. EXPOSE "8080/tcp"
  40. # TODO: à remettre une fois le bug corrigé
  41. #HEALTHCHECK --interval="5s" \
  42. # CMD curl --fail "http://localhost:8080" || exit 1