Dockerfile 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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_BRANCH
  19. ARG SOURCE_COMMIT
  20. LABEL \
  21. org.opencontainers.image.authors="Alkarex" \
  22. org.opencontainers.image.description="A self-hosted RSS feed aggregator" \
  23. org.opencontainers.image.documentation="https://freshrss.github.io/FreshRSS/" \
  24. org.opencontainers.image.licenses="AGPL-3.0" \
  25. org.opencontainers.image.revision="${SOURCE_BRANCH}.${SOURCE_COMMIT}" \
  26. org.opencontainers.image.source="https://github.com/FreshRSS/FreshRSS" \
  27. org.opencontainers.image.title="FreshRSS" \
  28. org.opencontainers.image.url="https://freshrss.org/" \
  29. org.opencontainers.image.vendor="FreshRSS" \
  30. org.opencontainers.image.version="$FRESHRSS_VERSION"
  31. RUN a2dismod -q -f alias autoindex negotiation status && \
  32. a2dismod -q auth_openidc && \
  33. a2enmod -q deflate expires 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. ENTRYPOINT ["./Docker/entrypoint.sh"]
  53. EXPOSE 80
  54. # hadolint ignore=DL3025
  55. CMD ([ -z "$CRON_MIN" ] || cron) && \
  56. . /etc/apache2/envvars && \
  57. exec apache2 -D FOREGROUND $([ -n "$OIDC_ENABLED" ] && [ "$OIDC_ENABLED" -ne 0 ] && echo '-D OIDC_ENABLED')