Dockerfile 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. FROM ubuntu:19.04
  2. ENV TZ UTC
  3. SHELL ["/bin/bash", "-o", "pipefail", "-c"]
  4. RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
  5. RUN apt-get update && \
  6. apt-get install --no-install-recommends -y \
  7. ca-certificates cron \
  8. apache2 libapache2-mod-php \
  9. php-curl php-gmp php-intl php-mbstring php-xml php-zip \
  10. php-sqlite3 php-mysql php-pgsql && \
  11. rm -rf /var/lib/apt/lists/*
  12. RUN mkdir -p /var/www/FreshRSS/ /run/apache2/
  13. WORKDIR /var/www/FreshRSS
  14. COPY . /var/www/FreshRSS
  15. COPY ./Docker/*.Apache.conf /etc/apache2/sites-available/
  16. ARG FRESHRSS_VERSION
  17. ARG SOURCE_BRANCH
  18. ARG SOURCE_COMMIT
  19. LABEL \
  20. org.opencontainers.image.authors="Alkarex" \
  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_BRANCH}.${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 a2dismod -f alias autoindex negotiation status && \
  31. a2enmod deflate expires headers mime setenvif && \
  32. a2disconf '*' && \
  33. a2dissite '*' && \
  34. a2ensite 'FreshRSS*'
  35. RUN sed -r -i "/^\s*(CustomLog|ErrorLog|Listen) /s/^/#/" /etc/apache2/apache2.conf && \
  36. sed -r -i "/^\s*Listen /s/^/#/" /etc/apache2/ports.conf && \
  37. touch /var/www/FreshRSS/Docker/env.txt && \
  38. echo "17,47 * * * * . /var/www/FreshRSS/Docker/env.txt; \
  39. su www-data -s /bin/sh -c 'php /var/www/FreshRSS/app/actualize_script.php' \
  40. 2>> /proc/1/fd/2 > /tmp/FreshRSS.log" | crontab -
  41. ENV COPY_SYSLOG_TO_STDERR On
  42. ENV CRON_MIN ''
  43. ENV FRESHRSS_ENV ''
  44. ENTRYPOINT ["./Docker/entrypoint.sh"]
  45. EXPOSE 80
  46. # hadolint ignore=DL3025
  47. CMD ([ -z "$CRON_MIN" ] || cron) && \
  48. . /etc/apache2/envvars && \
  49. exec apache2 -D FOREGROUND
  50. HEALTHCHECK --start-period=20s --interval=37s --timeout=5s --retries=3 \
  51. CMD (php -r "readfile('http://localhost/i/');" | grep -q 'jsonVars') || exit 1