4
0

Dockerfile-Alpine 2.7 KB

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