Dockerfile 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. FROM debian:12-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. RUN mkdir -p /var/www/FreshRSS/ /run/apache2/
  14. WORKDIR /var/www/FreshRSS
  15. COPY . /var/www/FreshRSS
  16. COPY ./Docker/*.Apache.conf /etc/apache2/sites-available/
  17. ARG FRESHRSS_VERSION
  18. ARG SOURCE_COMMIT
  19. LABEL \
  20. org.opencontainers.image.authors="Alkarex" \
  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 a2dismod -q -f alias autoindex negotiation status && \
  31. a2dismod -q auth_openidc && \
  32. phpdismod calendar exif ffi ftp gettext mysqli posix readline shmop sockets sysvmsg sysvsem sysvshm xsl && \
  33. a2enmod -q deflate expires filter headers mime remoteip setenvif && \
  34. a2disconf -q '*' && \
  35. a2dissite -q '*' && \
  36. a2ensite -q 'FreshRSS*'
  37. RUN sed -r -i "/^\s*(CustomLog|ErrorLog|Listen) /s/^/#/" /etc/apache2/apache2.conf && \
  38. sed -r -i "/^\s*Listen /s/^/#/" /etc/apache2/ports.conf && \
  39. # Disable built-in updates when using Docker, as the full image is supposed to be updated instead.
  40. sed -r -i "\\#disable_update#s#^.*#\t'disable_update' => true,#" ./config.default.php && \
  41. touch /var/www/FreshRSS/Docker/env.txt && \
  42. echo "7,37 * * * * . /var/www/FreshRSS/Docker/env.txt; \
  43. su www-data -s /bin/sh -c 'php /var/www/FreshRSS/app/actualize_script.php' \
  44. 2>> /proc/1/fd/2 > /tmp/FreshRSS.log" > /etc/crontab.freshrss.default
  45. ENV COPY_LOG_TO_SYSLOG=On
  46. ENV COPY_SYSLOG_TO_STDERR=On
  47. ENV CRON_MIN=''
  48. ENV DATA_PATH=''
  49. ENV FRESHRSS_ENV=''
  50. ENV LISTEN=''
  51. ENV OIDC_ENABLED=''
  52. ENV TRUSTED_PROXY=''
  53. ENTRYPOINT ["./Docker/entrypoint.sh"]
  54. EXPOSE 80
  55. # hadolint ignore=DL3025
  56. CMD ([ -z "$CRON_MIN" ] || cron) && \
  57. . /etc/apache2/envvars && \
  58. exec apache2 -D FOREGROUND $([ -n "$OIDC_ENABLED" ] && [ "$OIDC_ENABLED" -ne 0 ] && echo '-D OIDC_ENABLED')