Dockerfile-Oldest 2.8 KB

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