Dockerfile-Alpine 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. FROM alpine:3.15
  2. ENV TZ UTC
  3. SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
  4. RUN apk add --no-cache \
  5. apache2 php8-apache2 \
  6. php8 php8-curl php8-gmp php8-intl php8-mbstring php8-xml php8-zip \
  7. php8-ctype php8-dom php8-fileinfo php8-iconv php8-json php8-opcache php8-phar php8-session php8-simplexml php8-xmlreader php8-xmlwriter php8-tokenizer php8-zlib \
  8. php8-pdo_sqlite php8-pdo_mysql php8-pdo_pgsql
  9. RUN mkdir -p /var/www/FreshRSS /run/apache2/
  10. WORKDIR /var/www/FreshRSS
  11. COPY . /var/www/FreshRSS
  12. COPY ./Docker/*.Apache.conf /etc/apache2/conf.d/
  13. ARG FRESHRSS_VERSION
  14. ARG SOURCE_BRANCH
  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_BRANCH}.${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|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/php8 /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 FRESHRSS_ENV ''
  46. ENV LISTEN ''
  47. ENTRYPOINT ["./Docker/entrypoint.sh"]
  48. EXPOSE 80
  49. # hadolint ignore=DL3025
  50. CMD ([ -z "$CRON_MIN" ] || crond -d 6) && \
  51. exec httpd -D FOREGROUND