Dockerfile-Arch 2.9 KB

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