Dockerfile-Newest 3.0 KB

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