Dockerfile-Newest 3.0 KB

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