Dockerfile 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. FROM ubuntu:19.04
  2. ENV TZ UTC
  3. RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
  4. RUN apt update && \
  5. apt install --no-install-recommends -y \
  6. ca-certificates cron curl \
  7. apache2 libapache2-mod-php \
  8. php-curl php-intl php-mbstring php-xml php-zip \
  9. php-sqlite3 php-mysql php-pgsql && \
  10. rm -rf /var/lib/apt/lists/*
  11. RUN mkdir -p /var/www/FreshRSS/ /run/apache2/
  12. WORKDIR /var/www/FreshRSS
  13. COPY . /var/www/FreshRSS
  14. COPY ./Docker/*.Apache.conf /etc/apache2/sites-available/
  15. ARG FRESHRSS_VERSION
  16. ARG SOURCE_BRANCH
  17. ARG SOURCE_COMMIT
  18. LABEL \
  19. org.opencontainers.image.authors="Alkarex" \
  20. org.opencontainers.image.description="A self-hosted RSS feed aggregator" \
  21. org.opencontainers.image.documentation="https://freshrss.github.io/FreshRSS/" \
  22. org.opencontainers.image.licenses="AGPL-3.0" \
  23. org.opencontainers.image.revision="${SOURCE_BRANCH}.${SOURCE_COMMIT}" \
  24. org.opencontainers.image.source="https://github.com/FreshRSS/FreshRSS" \
  25. org.opencontainers.image.title="FreshRSS" \
  26. org.opencontainers.image.url="https://freshrss.org/" \
  27. org.opencontainers.image.vendor="FreshRSS" \
  28. org.opencontainers.image.version="$FRESHRSS_VERSION"
  29. RUN a2dismod -f alias autoindex negotiation status && \
  30. a2enmod deflate expires headers mime setenvif && \
  31. a2disconf '*' && \
  32. a2dissite '*' && \
  33. a2ensite 'FreshRSS*'
  34. RUN sed -r -i "/^\s*(CustomLog|ErrorLog|Listen) /s/^/#/" /etc/apache2/apache2.conf && \
  35. sed -r -i "/^\s*Listen /s/^/#/" /etc/apache2/ports.conf && \
  36. touch /var/www/FreshRSS/Docker/env.txt && \
  37. echo "17,47 * * * * . /var/www/FreshRSS/Docker/env.txt; \
  38. su www-data -s /bin/sh -c 'php /var/www/FreshRSS/app/actualize_script.php' \
  39. 2>> /proc/1/fd/2 > /tmp/FreshRSS.log" | crontab -
  40. ENV COPY_SYSLOG_TO_STDERR On
  41. ENV CRON_MIN ''
  42. ENTRYPOINT ["./Docker/entrypoint.sh"]
  43. EXPOSE 80
  44. CMD ([ -z "$CRON_MIN" ] || cron) && \
  45. . /etc/apache2/envvars && \
  46. exec apache2 -D FOREGROUND
  47. HEALTHCHECK --start-period=8s --interval=67s --timeout=5s --retries=3 \
  48. CMD curl -fsS 'http://localhost/i/' | grep -q 'jsonVars' || exit 1