Dockerfile 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. FROM debian:13-slim
  2. ENV TZ=UTC
  3. SHELL ["/bin/bash", "-o", "pipefail", "-c"]
  4. ARG DEBIAN_FRONTEND=noninteractive
  5. RUN apt-get update && \
  6. apt-get install --no-install-recommends -y \
  7. ca-certificates cron \
  8. apache2 libapache2-mod-php \
  9. libapache2-mod-auth-openidc \
  10. php-curl php-gmp php-intl php-mbstring php-xml php-zip \
  11. php-sqlite3 php-mysql php-pgsql && \
  12. rm -rf /var/lib/apt/lists/*
  13. # hadolint ignore=DL3059
  14. RUN mkdir -p /var/www/FreshRSS/ /run/apache2/
  15. WORKDIR /var/www/FreshRSS
  16. COPY --chown=root:www-data . /var/www/FreshRSS
  17. COPY ./Docker/*.Apache.conf /etc/apache2/sites-available/
  18. ARG FRESHRSS_VERSION
  19. ARG SOURCE_COMMIT
  20. LABEL \
  21. org.opencontainers.image.description="A self-hosted RSS feed aggregator" \
  22. org.opencontainers.image.documentation="https://freshrss.github.io/FreshRSS/" \
  23. org.opencontainers.image.licenses="AGPL-3.0" \
  24. org.opencontainers.image.revision="${SOURCE_COMMIT}" \
  25. org.opencontainers.image.source="https://github.com/FreshRSS/FreshRSS" \
  26. org.opencontainers.image.title="FreshRSS" \
  27. org.opencontainers.image.url="https://freshrss.org/" \
  28. org.opencontainers.image.vendor="FreshRSS" \
  29. org.opencontainers.image.version="$FRESHRSS_VERSION"
  30. RUN \
  31. # Disable unwanted Apache modules and configurations
  32. a2dismod -q -f alias autoindex negotiation status && \
  33. a2dismod -q auth_openidc && \
  34. a2disconf -q '*' && \
  35. a2dissite -q '*' && \
  36. sed -r -i "/^\s*(CustomLog|ErrorLog|Listen) /s/^/#/" /etc/apache2/apache2.conf && \
  37. sed -r -i "/^\s*Listen /s/^/#/" /etc/apache2/ports.conf && \
  38. # Enable required Apache modules
  39. a2enmod -q deflate expires filter headers mime remoteip setenvif && \
  40. # Enable FreshRSS configuration for Apache
  41. a2ensite -q 'FreshRSS*' && \
  42. # Disable unwanted PHP modules
  43. phpdismod calendar exif ffi ftp gettext mysqli posix readline shmop sockets sysvmsg sysvsem sysvshm xsl && \
  44. # Disable built-in FreshRSS updates when using Docker, as the full image is supposed to be updated instead
  45. sed -r -i "\\#disable_update#s#^.*#\t'disable_update' => true,#" ./config.default.php && \
  46. # Configure cron job
  47. touch /var/www/FreshRSS/Docker/env.txt && \
  48. echo "7,37 * * * * . /var/www/FreshRSS/Docker/env.txt; \
  49. su www-data -s /bin/sh -c 'php /var/www/FreshRSS/app/actualize_script.php' \
  50. 2>> /proc/1/fd/2 > /tmp/FreshRSS.log" > /etc/crontab.freshrss.default
  51. ENV COPY_LOG_TO_SYSLOG=On
  52. ENV COPY_SYSLOG_TO_STDERR=On
  53. ENV CRON_MIN=''
  54. ENV DATA_PATH=''
  55. ENV ENABLE_ACCESS_LOG=1
  56. ENV FRESHRSS_ENV=''
  57. ENV LISTEN=''
  58. ENV OIDC_ENABLED=''
  59. ENV TRUSTED_PROXY=''
  60. ENTRYPOINT ["./Docker/entrypoint.sh"]
  61. EXPOSE 80
  62. # hadolint ignore=DL3025
  63. CMD ([ -z "$CRON_MIN" ] || cron) && \
  64. . /etc/apache2/envvars && \
  65. exec apache2 -D FOREGROUND $([ -n "$OIDC_ENABLED" ] && [ "$OIDC_ENABLED" -ne 0 ] && echo "-D OIDC_ENABLED")