A free, self-hostable news aggregator…
Docker uniform timezone behaviour (#4905)
Alexandre Alapetite543fa4e76c17
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfileindex f51c58cc8..a2c1a2a2b 100644--- a/.devcontainer/Dockerfile+++ b/.devcontainer/Dockerfile@@ -2,10 +2,9 @@ FROM alpine:3.17ENV TZ UTCSHELL ["/bin/ash", "-eo", "pipefail", "-c"]-RUN apk add --no-cache tzdata && \- ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezoneRUN apk add --no-cache \+ tzdata \apache2 php-apache2 \php php-curl php-gmp php-intl php-mbstring php-xml php-zip \php-ctype php-dom php-fileinfo php-iconv php-json php-opcache php-openssl php-phar php-session php-simplexml php-xmlreader php-xmlwriter php-xml php-tokenizer php-zlib \diff --git a/Docker/Dockerfile b/Docker/Dockerfileindex b462263fb..08e6dce43 100644--- a/Docker/Dockerfile+++ b/Docker/Dockerfile@@ -2,8 +2,8 @@ FROM debian:11-slimENV TZ UTCSHELL ["/bin/bash", "-o", "pipefail", "-c"]-RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone+ARG DEBIAN_FRONTEND=noninteractiveRUN apt-get update && \apt-get install --no-install-recommends -y \ca-certificates cron \diff --git a/Docker/Dockerfile-Alpine b/Docker/Dockerfile-Alpineindex 9bc74800e..65c2de6be 100644--- a/Docker/Dockerfile-Alpine+++ b/Docker/Dockerfile-Alpine@@ -2,10 +2,9 @@ FROM alpine:3.17ENV TZ UTCSHELL ["/bin/ash", "-eo", "pipefail", "-c"]-RUN apk add --no-cache tzdata && \- ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezoneRUN apk add --no-cache \+ tzdata \apache2 php-apache2 \php php-curl php-gmp php-intl php-mbstring php-xml php-zip \php-ctype php-dom php-fileinfo php-iconv php-json php-opcache php-openssl php-phar php-session php-simplexml php-xmlreader php-xmlwriter php-xml php-tokenizer php-zlib \diff --git a/Docker/Dockerfile-Oldest b/Docker/Dockerfile-Oldestindex b4dc13ddc..ede1ba643 100644--- a/Docker/Dockerfile-Oldest+++ b/Docker/Dockerfile-Oldest@@ -2,7 +2,9 @@ FROM alpine:3.8ENV TZ UTCSHELL ["/bin/ash", "-eo", "pipefail", "-c"]+RUN apk add --no-cache \+ tzdata \apache2 php7-apache2 \php7 php7-curl php7-gmp php7-intl php7-mbstring php7-xml php7-zip \php7-ctype php7-dom php7-iconv php7-json php7-opcache php7-openssl php7-phar php7-session php7-xmlreader php7-xml php7-zlib \diff --git a/Docker/Dockerfile-QEMU-ARM b/Docker/Dockerfile-QEMU-ARMindex 042597dec..892cbc955 100644--- a/Docker/Dockerfile-QEMU-ARM+++ b/Docker/Dockerfile-QEMU-ARM@@ -8,8 +8,8 @@ COPY ./Docker/qemu-arm-* /usr/bin/ENV TZ UTCSHELL ["/bin/bash", "-o", "pipefail", "-c"]-RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone+ARG DEBIAN_FRONTEND=noninteractiveRUN apt-get update && \apt-get install --no-install-recommends -y \ca-certificates cron \diff --git a/Docker/README.md b/Docker/README.mdindex 44963ba0c..a4c0e8289 100644--- a/Docker/README.md+++ b/Docker/README.md@@ -81,7 +81,7 @@ and with newer packages in general (Apache, PHP).## Environment variables-* `TZ`: (default is `UTC`) A [server timezone](http://php.net/timezones) (default is `UTC`)+* `TZ`: (default is `UTC`) A [server timezone](http://php.net/timezones)* `CRON_MIN`: (default is disabled) Define minutes for the built-in cron job to automatically refresh feeds (see below for more advanced options)* `FRESHRSS_ENV`: (default is `production`) Enables additional development information if set to `development` (increases the level of logging and ensures that errors are displayed) (see below for more development options)* `COPY_LOG_TO_SYSLOG`: (default is `On`) Copy all the logs to syslog@@ -303,6 +303,7 @@ services:options:max-size: 10mvolumes:+ # Recommended volume for FreshRSS persistent data such as configuration and SQLite databases- data:/var/www/FreshRSS/data# Optional volume for storing third-party extensions- extensions:/var/www/FreshRSS/extensions@@ -314,8 +315,11 @@ services:# If you want to open a port 8080 on the local machine:- "8080:80"environment:+ # A timezone http://php.net/timezones (default is UTC)TZ: Europe/Paris+ # Cron job to refresh feeds at specified minutesCRON_MIN: '2,32'+ # 'development' for additional logs; default is 'production'FRESHRSS_ENV: development# Optional advanced parameter controlling the internal Apache listening portLISTEN: 0.0.0.0:80diff --git a/Docker/entrypoint.sh b/Docker/entrypoint.shindex 82c2e358e..00e80f629 100755--- a/Docker/entrypoint.sh+++ b/Docker/entrypoint.sh@@ -1,11 +1,14 @@#!/bin/sh-php -f ./cli/prepare.php >/dev/null+ln -snf "/usr/share/zoneinfo/$TZ" /etc/localtime+echo "$TZ" >/etc/timezonefind /etc/php*/ -type f -name php.ini -exec sed -r -i "\\#^;?date.timezone#s#^.*#date.timezone = $TZ#" {} \;find /etc/php*/ -type f -name php.ini -exec sed -r -i "\\#^;?post_max_size#s#^.*#post_max_size = 32M#" {} \;find /etc/php*/ -type f -name php.ini -exec sed -r -i "\\#^;?upload_max_filesize#s#^.*#upload_max_filesize = 32M#" {} \;+php -f ./cli/prepare.php >/dev/null+if [ -n "$LISTEN" ]; thenfind /etc/apache2/ -type f -name FreshRSS.Apache.conf -exec sed -r -i "\\#^Listen#s#^.*#Listen $LISTEN#" {} \;fi