Dockerfile-Arch 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # Test image for development
  2. # hadolint ignore=DL3006
  3. FROM archlinux
  4. ENV TZ=UTC
  5. SHELL ["/bin/bash", "-eo", "pipefail", "-c"]
  6. RUN pacman -Syu --noconfirm && pacman -S --noconfirm \
  7. cronie \
  8. apache php-apache \
  9. php \
  10. php-sqlite php-pgsql \
  11. && pacman -Scc --noconfirm
  12. RUN mkdir -p /var/www/FreshRSS /run/httpd/
  13. WORKDIR /var/www/FreshRSS
  14. COPY --chown=root:http . /var/www/FreshRSS
  15. COPY ./Docker/*.Apache.conf /etc/httpd/conf/conf.d/
  16. ARG FRESHRSS_VERSION
  17. ARG SOURCE_COMMIT
  18. LABEL \
  19. org.opencontainers.image.description="A self-hosted RSS feed aggregator" \
  20. org.opencontainers.image.documentation="https://freshrss.github.io/FreshRSS/" \
  21. org.opencontainers.image.licenses="AGPL-3.0" \
  22. org.opencontainers.image.revision="${SOURCE_COMMIT}" \
  23. org.opencontainers.image.source="https://github.com/FreshRSS/FreshRSS" \
  24. org.opencontainers.image.title="FreshRSS" \
  25. org.opencontainers.image.url="https://freshrss.org/" \
  26. org.opencontainers.image.vendor="FreshRSS" \
  27. org.opencontainers.image.version="$FRESHRSS_VERSION"
  28. RUN \
  29. # Disable unwanted Apache modules and configurations
  30. sed -r -i "/^\s*LoadModule .*mod_(alias|autoindex|negotiation|status).so$/s/^/#/" /etc/httpd/conf/httpd.conf && \
  31. sed -r -i "/^\s*Include .*\/(httpd-autoindex|httpd-languages|httpd-multilang-errordoc|httpd-userdir|proxy-html).conf$/s/^/#/" /etc/httpd/conf/httpd.conf && \
  32. sed -r -i "/^\s*(CustomLog|ErrorLog|Listen) /s/^/#/" /etc/httpd/conf/httpd.conf && \
  33. # Enable required Apache modules
  34. sed -r -i "/^\s*#\s*LoadModule .*mod_(deflate|expires|filter|headers|mime|remoteip|setenvif).so$/s/^\s*#//" /etc/httpd/conf/httpd.conf && \
  35. # Configure PHP for Apache
  36. sed -r -i 's|^#?LoadModule mpm_event_module|#LoadModule mpm_event_module|' /etc/httpd/conf/httpd.conf && \
  37. sed -r -i 's|^#?LoadModule mpm_prefork_module|LoadModule mpm_prefork_module|' /etc/httpd/conf/httpd.conf && \
  38. sed -r -i '/LoadModule mpm_prefork_module.*/a LoadModule php_module modules/libphp.so\nAddHandler php-script .php' /etc/httpd/conf/httpd.conf && \
  39. # Enable required PHP extensions
  40. sed -r -i "/;extension=(curl|gmp|iconv|intl|pdo_mysql|pdo_pgsql|pdo_sqlite|zip)$/s/^;//" /etc/php/php.ini && \
  41. # Disable built-in FreshRSS updates when using Docker, as the full image is supposed to be updated instead
  42. sed -r -i "\\#disable_update#s#^.*#\t'disable_update' => true,#" ./config.default.php && \
  43. touch /var/www/FreshRSS/Docker/env.txt && \
  44. echo "17,47 * * * * . /var/www/FreshRSS/Docker/env.txt; \
  45. su http -s /bin/sh -c 'php /var/www/FreshRSS/app/actualize_script.php' \
  46. 2>> /proc/1/fd/2 > /tmp/FreshRSS.log" > /etc/crontab.freshrss.default
  47. ENV COPY_LOG_TO_SYSLOG=On
  48. ENV COPY_SYSLOG_TO_STDERR=On
  49. ENV CRON_MIN=''
  50. ENV DATA_PATH=''
  51. ENV FRESHRSS_ENV=''
  52. ENV LISTEN=''
  53. ENV OIDC_ENABLED=''
  54. ENV TRUSTED_PROXY=''
  55. ENTRYPOINT ["./Docker/entrypoint.sh"]
  56. EXPOSE 80
  57. # hadolint ignore=DL3025
  58. CMD ([ -z "$CRON_MIN" ] || crond) && \
  59. exec httpd -D FOREGROUND