Dockerfile 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. FROM debian:11-slim
  2. ENV TZ UTC
  3. SHELL ["/bin/bash", "-o", "pipefail", "-c"]
  4. RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
  5. RUN apt-get update && \
  6. apt-get install --no-install-recommends -y \
  7. ca-certificates cron \
  8. apache2 libapache2-mod-php \
  9. php-curl php-gmp php-intl php-mbstring php-xml php-zip \
  10. php-sqlite3 php-mysql php-pgsql && \
  11. rm -rf /var/lib/apt/lists/*
  12. RUN mkdir -p /var/www/FreshRSS/ /run/apache2/
  13. WORKDIR /var/www/FreshRSS
  14. COPY . /var/www/FreshRSS
  15. COPY ./Docker/*.Apache.conf /etc/apache2/sites-available/
  16. ARG FRESHRSS_VERSION
  17. ARG SOURCE_BRANCH
  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_BRANCH}.${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 -f alias autoindex negotiation status && \
  31. a2enmod deflate expires headers mime remoteip setenvif && \
  32. a2disconf '*' && \
  33. a2dissite '*' && \
  34. a2ensite 'FreshRSS*'
  35. RUN sed -r -i "/^\s*(CustomLog|ErrorLog|Listen) /s/^/#/" /etc/apache2/apache2.conf && \
  36. sed -r -i "/^\s*Listen /s/^/#/" /etc/apache2/ports.conf && \
  37. # Disable built-in updates when using Docker, as the full image is supposed to be updated instead.
  38. sed -r -i "\\#disable_update#s#^.*#\t'disable_update' => true,#" ./config.default.php && \
  39. touch /var/www/FreshRSS/Docker/env.txt && \
  40. echo "7,37 * * * * . /var/www/FreshRSS/Docker/env.txt; \
  41. su www-data -s /bin/sh -c 'php /var/www/FreshRSS/app/actualize_script.php' \
  42. 2>> /proc/1/fd/2 > /tmp/FreshRSS.log" > /etc/crontab.freshrss.default
  43. ENV COPY_LOG_TO_SYSLOG On
  44. ENV COPY_SYSLOG_TO_STDERR On
  45. ENV CRON_MIN ''
  46. ENV FRESHRSS_ENV ''
  47. ENV LISTEN ''
  48. ENTRYPOINT ["./Docker/entrypoint.sh"]
  49. EXPOSE 80
  50. # hadolint ignore=DL3025
  51. CMD ([ -z "$CRON_MIN" ] || cron) && \
  52. . /etc/apache2/envvars && \
  53. exec apache2 -D FOREGROUND