From 534c1575b9de5893398a4f9c49b19870d4b5bb37 Mon Sep 17 00:00:00 2001 From: Adrien le Maire Date: Sat, 12 Sep 2020 10:16:24 +0200 Subject: [PATCH] bump debian version & add freshrss --- .gitlab-ci.yml | 22 ++++++++++++++++ freshrss/Dockerfile | 58 ++++++++++++++++++++++++++++++++++++++++++ freshrss/Makefile | 18 +++++++++++++ freshrss/entrypoint.sh | 15 +++++++++++ freshrss/version | 1 + keycloak/Dockerfile | 2 +- watchdog/Dockerfile | 2 +- 7 files changed, 116 insertions(+), 2 deletions(-) create mode 100644 freshrss/Dockerfile create mode 100644 freshrss/Makefile create mode 100644 freshrss/entrypoint.sh create mode 100644 freshrss/version diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 47e68cf..5007c2b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,6 +7,28 @@ variables: DOCKER_BUILDKIT: 1 +dev-freshrss: + stage: build + tags: + - docker + script: + - cd freshrss + - make nopush + only: + variables: + - $CI_COMMIT_REF_PROTECTED == "false" + +freshrss: + stage: build + tags: + - docker + script: + - cd freshrss + - make push + only: + variables: + - $CI_COMMIT_REF_PROTECTED == "true" + dev-watchdog: stage: build tags: diff --git a/freshrss/Dockerfile b/freshrss/Dockerfile new file mode 100644 index 0000000..17a1720 --- /dev/null +++ b/freshrss/Dockerfile @@ -0,0 +1,58 @@ +FROM debian:buster-20200908-slim +ARG DEBIAN_FRONTEND=noninteractive + +ENV TZ UTC +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN apt-get update -qq && \ + apt-get install --no-install-recommends -qqy \ + ca-certificates cron \ + apache2 libapache2-mod-php \ + php-curl php-gmp php-intl php-mbstring php-xml php-zip \ + php-sqlite3 php-mysql php-pgsql && \ + rm -rf /var/lib/apt/lists/* + +RUN mkdir -p /var/www/ /run/apache2/ + +ARG VERSION +ARG SRC=https://github.com/FreshRSS/FreshRSS/archive/${VERSION}.tar.gz +RUN wget $SRC && tar -xf ${VERSION}.tar.gz && rm {VERSION}.tar.gz && \ + mv FreshRSS-${VERSION} /var/www/FreshRSS && \ + mv /var/www/FreshRSS/Docker/FreshRSS.Apache.conf /etc/apache2/sites-available/ && \ + sed -i "s/\:80/\:8080/" /etc/apache2/sites-available/FreshRSS.Apache.conf && \ + sed -i "s/OS/Prod/" /etc/apache2/sites-available/FreshRSS.Apache.conf && \ +ADD entrypoint.sh /var/www/FreshRSS/Docker/entrypoint.sh + +RUN a2dismod -f alias autoindex negotiation status && \ + a2enmod deflate expires headers mime setenvif && \ + a2disconf '*' && \ + a2dissite '*' && \ + a2ensite 'FreshRSS*' + +RUN sed -r -i "/^\s*(CustomLog|ErrorLog|Listen) /s/^/#/" /etc/apache2/apache2.conf && \ + sed -r -i "/^\s*Listen /s/^/#/" /etc/apache2/ports.conf && \ + touch /var/www/FreshRSS/Docker/env.txt && \ + echo "7,37 * * * * . /var/www/FreshRSS/Docker/env.txt; \ + su www-data -s /bin/sh -c 'php /var/www/FreshRSS/app/actualize_script.php' \ + 2>> /proc/1/fd/2 > /tmp/FreshRSS.log" | crontab - +WORKDIR /var/www/FreshRSS +RUN chown -R :www-data . && \ + chmod -R g+r . && chmod -R g+w ./data/ && \ + find /etc/php*/ -name php.ini -exec sed -r -i "\\#^;?date.timezone#s#^.*#date.timezone = $TZ#" {} \; && \ + find /etc/php*/ -name php.ini -exec sed -r -i "\\#^;?post_max_size#s#^.*#post_max_size = 32M#" {} \; && \ + find /etc/php*/ -name php.ini -exec sed -r -i "\\#^;?upload_max_filesize#s#^.*#upload_max_filesize = 32M#" {} \; + +ENV COPY_LOG_TO_SYSLOG On +ENV COPY_SYSLOG_TO_STDERR On +ENV CRON_MIN '' +ENV FRESHRSS_ENV '' + +# UID of www-data +USER 33 +ENTRYPOINT ["./Docker/entrypoint.sh"] + +EXPOSE 8080 +CMD ([ -z "$CRON_MIN" ] || cron) && \ + . /etc/apache2/envvars && \ + exec apache2 -D FOREGROUND diff --git a/freshrss/Makefile b/freshrss/Makefile new file mode 100644 index 0000000..fdfc1d8 --- /dev/null +++ b/freshrss/Makefile @@ -0,0 +1,18 @@ +NAMESPACE=alemairebe +include version + +IMAGE=freshrss + +nopush: + docker buildx build --platform linux/amd64 --load \ + --build-arg VERSION=$(VERSION) \ + --tag ${NAMESPACE}/${IMAGE}:$(VERSION) . + + +push: + docker buildx build --platform linux/amd64,linux/arm64,linux/arm,linux/ppc64le --push \ + --build-arg VERSION=$(VERSION) \ + --cache-from=type=registry,ref=${NAMESPACE}/buildx:${IMAGE} \ + --cache-to=type=registry,ref=${NAMESPACE}/buildx:${IMAGE} \ + --tag ${NAMESPACE}/${IMAGE}:$(VERSION) . + diff --git a/freshrss/entrypoint.sh b/freshrss/entrypoint.sh new file mode 100644 index 0000000..0d2e7a7 --- /dev/null +++ b/freshrss/entrypoint.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +php -f ./cli/prepare.php >/dev/null + +if [ -n "$CRON_MIN" ]; then + ( + echo "export TZ=$TZ" + echo "export COPY_LOG_TO_SYSLOG=$COPY_LOG_TO_SYSLOG" + echo "export COPY_SYSLOG_TO_STDERR=$COPY_SYSLOG_TO_STDERR" + echo "export FRESHRSS_ENV=$FRESHRSS_ENV" + ) >/var/www/FreshRSS/Docker/env.txt + crontab -l | sed -r "\\#FreshRSS#s#^[^ ]+ #$CRON_MIN #" | crontab - +fi + +exec "$@" diff --git a/freshrss/version b/freshrss/version new file mode 100644 index 0000000..ce52989 --- /dev/null +++ b/freshrss/version @@ -0,0 +1 @@ +VERSION=1.16.2 diff --git a/keycloak/Dockerfile b/keycloak/Dockerfile index 838d348..81a021b 100644 --- a/keycloak/Dockerfile +++ b/keycloak/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:buster-20200803-slim +FROM debian:buster-20200908-slim ADD https://curl.haxx.se/ca/cacert.pem /etc/ssl/certs/cacert.pem ENV CURL_CA_BUNDLE=/etc/ssl/certs/cacert.pem diff --git a/watchdog/Dockerfile b/watchdog/Dockerfile index 076e53e..87ae439 100644 --- a/watchdog/Dockerfile +++ b/watchdog/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:buster-20200803-slim +FROM debian:buster-20200908-slim ARG DEBIAN_FRONTEND=noninteractive ARG VERSION RUN apt update -qq && \