Dockerfile-Alpine 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. FROM alpine:3.10
  2. ENV TZ UTC
  3. SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
  4. RUN apk add --no-cache \
  5. apache2 php7-apache2 \
  6. php7 php7-curl php7-gmp php7-intl php7-mbstring php7-xml php7-zip \
  7. php7-ctype php7-dom php7-fileinfo php7-iconv php7-json php7-opcache php7-session php7-simplexml php7-xmlreader php7-zlib \
  8. php7-pdo_sqlite php7-pdo_mysql php7-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|setenvif).so$/s/^\s*#//" \
  32. /etc/apache2/httpd.conf && \
  33. sed -r -i "/^\s*(CustomLog|ErrorLog|Listen) /s/^/#/" \
  34. /etc/apache2/httpd.conf && \
  35. touch /var/www/FreshRSS/Docker/env.txt && \
  36. echo "27,57 * * * * . /var/www/FreshRSS/Docker/env.txt; \
  37. su apache -s /bin/sh -c 'php /var/www/FreshRSS/app/actualize_script.php' \
  38. 2>> /proc/1/fd/2 > /tmp/FreshRSS.log" | crontab -
  39. ENV COPY_LOG_TO_SYSLOG On
  40. ENV COPY_SYSLOG_TO_STDERR On
  41. ENV CRON_MIN ''
  42. ENV FRESHRSS_ENV ''
  43. ENTRYPOINT ["./Docker/entrypoint.sh"]
  44. EXPOSE 80
  45. # hadolint ignore=DL3025
  46. CMD ([ -z "$CRON_MIN" ] || crond -d 6) && \
  47. exec httpd -D FOREGROUND
  48. HEALTHCHECK --start-period=20s --interval=37s --timeout=5s --retries=3 \
  49. CMD (php -r "readfile('http://localhost/i/');" | grep -q 'jsonVars') || exit 1