Dockerfile-Oldest 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # Test image for development
  2. FROM alpine:3.18
  3. ENV TZ=UTC
  4. SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
  5. RUN apk add --no-cache \
  6. tzdata \
  7. apache2 php82-apache2 \
  8. php82 php82-curl php82-gmp php82-intl php82-mbstring php82-xml php82-zip \
  9. php82-ctype php82-dom php82-fileinfo php82-iconv php82-json php82-opcache php82-openssl php82-phar php82-session php82-simplexml php82-xmlwriter php82-xml php82-tokenizer php82-zlib \
  10. php82-pdo_sqlite php82-pdo_mysql php82-pdo_pgsql
  11. # hadolint ignore=DL3059
  12. RUN mkdir -p /var/www/FreshRSS /run/apache2/
  13. WORKDIR /var/www/FreshRSS
  14. COPY --chown=root:www-data . /var/www/FreshRSS
  15. COPY ./Docker/*.Apache.conf /etc/apache2/conf.d/
  16. ARG FRESHRSS_VERSION
  17. ARG SOURCE_COMMIT
  18. LABEL \
  19. org.opencontainers.image.description="A self-hosted RSS feed aggregator" \
  20. org.opencontainers.image.documentation="https://freshrss.github.io/FreshRSS/" \
  21. org.opencontainers.image.licenses="AGPL-3.0" \
  22. org.opencontainers.image.revision="${SOURCE_COMMIT}" \
  23. org.opencontainers.image.source="https://github.com/FreshRSS/FreshRSS" \
  24. org.opencontainers.image.title="FreshRSS" \
  25. org.opencontainers.image.url="https://freshrss.org/" \
  26. org.opencontainers.image.vendor="FreshRSS" \
  27. org.opencontainers.image.version="$FRESHRSS_VERSION"
  28. RUN \
  29. # Disable unwanted Apache modules and configurations
  30. rm -f /etc/apache2/conf.d/languages.conf /etc/apache2/conf.d/info.conf \
  31. /etc/apache2/conf.d/status.conf /etc/apache2/conf.d/userdir.conf && \
  32. sed -r -i "/^\s*LoadModule .*mod_(alias|autoindex|negotiation|status).so$/s/^/#/" \
  33. /etc/apache2/httpd.conf && \
  34. sed -r -i "/^\s*(CustomLog|ErrorLog|Listen) /s/^/#/" \
  35. /etc/apache2/httpd.conf && \
  36. # Enable required Apache modules
  37. sed -r -i "/^\s*#\s*LoadModule .*mod_(deflate|expires|filter|headers|mime|remoteip|setenvif).so$/s/^\s*#//" \
  38. /etc/apache2/httpd.conf && \
  39. # PHP configuration
  40. if [ ! -f /usr/bin/php ]; then ln -s /usr/bin/php82 /usr/bin/php; else true; fi && \
  41. echo 'memory_limit = 256M' > /etc/php82/conf.d/10_memory.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. # Configure cron job
  45. touch /var/www/FreshRSS/Docker/env.txt && \
  46. echo "27,57 * * * * . /var/www/FreshRSS/Docker/env.txt; \
  47. su apache -s /bin/sh -c 'php /var/www/FreshRSS/app/actualize_script.php' \
  48. 2>> /proc/1/fd/2 > /tmp/FreshRSS.log" > /etc/crontab.freshrss.default
  49. ENV COPY_LOG_TO_SYSLOG=On
  50. ENV COPY_SYSLOG_TO_STDERR=On
  51. ENV CRON_MIN=''
  52. ENV DATA_PATH=''
  53. ENV ENABLE_ACCESS_LOG=1
  54. ENV FRESHRSS_ENV=''
  55. ENV LISTEN=''
  56. ENV OIDC_ENABLED=''
  57. ENV TRUSTED_PROXY=''
  58. ENTRYPOINT ["./Docker/entrypoint.sh"]
  59. EXPOSE 80
  60. # hadolint ignore=DL3025
  61. CMD ([ -z "$CRON_MIN" ] || crond -d 6) && \
  62. exec httpd -D FOREGROUND $([ -n "$OIDC_ENABLED" ] && [ "$OIDC_ENABLED" -ne 0 ] && echo "-D OIDC_ENABLED")