Dockerfile-Alpine 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. FROM alpine:3.22
  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.authors="Alkarex" \
  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 rm -f /etc/apache2/conf.d/languages.conf /etc/apache2/conf.d/info.conf \
  28. /etc/apache2/conf.d/status.conf /etc/apache2/conf.d/userdir.conf && \
  29. sed -r -i "/^\s*LoadModule .*mod_(alias|autoindex|negotiation|status).so$/s/^/#/" \
  30. /etc/apache2/httpd.conf && \
  31. sed -r -i "/^\s*#\s*LoadModule .*mod_(deflate|expires|filter|headers|mime|remoteip|setenvif).so$/s/^\s*#//" \
  32. /etc/apache2/httpd.conf && \
  33. sed -r -i "/^\s*(CustomLog|ErrorLog|Listen) /s/^/#/" \
  34. /etc/apache2/httpd.conf && \
  35. if [ ! -f /usr/bin/php ]; then ln -s /usr/bin/php84 /usr/bin/php; else true; fi && \
  36. # Disable built-in updates when using Docker, as the full image is supposed to be updated instead.
  37. sed -r -i "\\#disable_update#s#^.*#\t'disable_update' => true,#" ./config.default.php && \
  38. touch /var/www/FreshRSS/Docker/env.txt && \
  39. echo "27,57 * * * * . /var/www/FreshRSS/Docker/env.txt; \
  40. su apache -s /bin/sh -c 'php /var/www/FreshRSS/app/actualize_script.php' \
  41. 2>> /proc/1/fd/2 > /tmp/FreshRSS.log" > /etc/crontab.freshrss.default
  42. ENV COPY_LOG_TO_SYSLOG=On
  43. ENV COPY_SYSLOG_TO_STDERR=On
  44. ENV CRON_MIN=''
  45. ENV DATA_PATH=''
  46. ENV FRESHRSS_ENV=''
  47. ENV LISTEN=''
  48. ENV OIDC_ENABLED=''
  49. ENV TRUSTED_PROXY=''
  50. ENTRYPOINT ["./Docker/entrypoint.sh"]
  51. EXPOSE 80
  52. # hadolint ignore=DL3025
  53. CMD ([ -z "$CRON_MIN" ] || crond -d 6) && \
  54. exec httpd -D FOREGROUND $([ -n "$OIDC_ENABLED" ] && [ "$OIDC_ENABLED" -ne 0 ] && echo '-D OIDC_ENABLED')