aboutsummaryrefslogtreecommitdiff
path: root/Docker
diff options
context:
space:
mode:
Diffstat (limited to 'Docker')
-rw-r--r--Docker/Dockerfile25
-rw-r--r--Docker/FreshRSS.Apache.conf34
-rw-r--r--Docker/README.md23
-rwxr-xr-xDocker/entrypoint.sh2
4 files changed, 58 insertions, 26 deletions
diff --git a/Docker/Dockerfile b/Docker/Dockerfile
index cca7bb65e..a4be9fd84 100644
--- a/Docker/Dockerfile
+++ b/Docker/Dockerfile
@@ -1,24 +1,31 @@
FROM alpine:3.8
+ENV TZ UTC
+
RUN apk add --no-cache \
apache2 php7-apache2 \
php7 php7-curl php7-gmp php7-intl php7-mbstring php7-xml php7-zip \
php7-ctype php7-dom php7-fileinfo php7-iconv php7-json php7-session php7-simplexml php7-xmlreader php7-zlib \
- php7-pdo_sqlite \
- php7-pdo_mysql \
- php7-pdo_pgsql
+ php7-pdo_sqlite php7-pdo_mysql php7-pdo_pgsql
-ENV FRESHRSS_ROOT /var/www/FreshRSS
-RUN mkdir -p ${FRESHRSS_ROOT} /run/apache2/
-WORKDIR ${FRESHRSS_ROOT}
+RUN mkdir -p /var/www/FreshRSS /run/apache2/
+WORKDIR /var/www/FreshRSS
-COPY . ${FRESHRSS_ROOT}
+COPY . /var/www/FreshRSS
COPY ./Docker/*.Apache.conf /etc/apache2/conf.d/
-RUN sed -r -i "/^[ ]*(CustomLog|ErrorLog|Listen) /s/^/#/" /etc/apache2/httpd.conf && \
- echo "17,37 * * * * php ${FRESHRSS_ROOT}/app/actualize_script.php 2>&1 | tee /tmp/FreshRSS.log" >> \
+RUN rm -f /etc/apache2/conf.d/languages.conf /etc/apache2/conf.d/info.conf \
+ /etc/apache2/conf.d/status.conf /etc/apache2/conf.d/userdir.conf && \
+ sed -r -i "/^\s*LoadModule .*mod_(alias|autoindex|negotiation|status).so$/s/^/#/" \
+ /etc/apache2/httpd.conf && \
+ sed -r -i "/^\s*#\s*LoadModule .*mod_(deflate|expires|headers|mime|setenvif).so$/s/^\s*#//" \
+ /etc/apache2/httpd.conf && \
+ sed -r -i "/^\s*(CustomLog|ErrorLog|Listen) /s/^/#/" \
+ /etc/apache2/httpd.conf && \
+ echo "17,37 * * * * su apache -s /bin/sh -c 'php /var/www/FreshRSS/app/actualize_script.php' 2>> /proc/1/fd/2 > /tmp/FreshRSS.log" >> \
/var/spool/cron/crontabs/root
+ENV COPY_SYSLOG_TO_STDERR On
ENV CRON_MIN ''
ENTRYPOINT ["./Docker/entrypoint.sh"]
diff --git a/Docker/FreshRSS.Apache.conf b/Docker/FreshRSS.Apache.conf
index adfc804c6..80f6389d8 100644
--- a/Docker/FreshRSS.Apache.conf
+++ b/Docker/FreshRSS.Apache.conf
@@ -1,19 +1,3 @@
-<IfModule !deflate_module>
- LoadModule deflate_module modules/mod_deflate.so
-</IfModule>
-<IfModule !expires_module>
- LoadModule expires_module modules/mod_expires.so
-</IfModule>
-<IfModule !headers_module>
- LoadModule headers_module modules/mod_headers.so
-</IfModule>
-<IfModule !mime_module>
- LoadModule mime_module modules/mod_mime.so
-</IfModule>
-<IfModule !rewrite_module>
- LoadModule rewrite_module modules/mod_rewrite.so
-</IfModule>
-
ServerName freshrss.localhost
Listen 0.0.0.0:80
DocumentRoot /var/www/FreshRSS/p/
@@ -21,7 +5,23 @@ CustomLog /dev/stdout combined
ErrorLog /dev/stderr
AllowEncodedSlashes On
+<Directory />
+ AllowOverride None
+ Options FollowSymLinks
+ Require all denied
+</Directory>
+
<Directory /var/www/FreshRSS/p>
- AllowOverride AuthConfig FileInfo Indexes Limit
+ AllowOverride None
+ Include /var/www/FreshRSS/p/.htaccess
+ Options FollowSymLinks
Require all granted
</Directory>
+
+<Directory /var/www/FreshRSS/p/api>
+ Include /var/www/FreshRSS/p/api/.htaccess
+</Directory>
+
+<Directory /var/www/FreshRSS/p/i>
+ IncludeOptional /var/www/FreshRSS/p/i/.htaccess
+</Directory>
diff --git a/Docker/README.md b/Docker/README.md
index 6b3871c6b..ac745c49d 100644
--- a/Docker/README.md
+++ b/Docker/README.md
@@ -66,6 +66,7 @@ sudo docker volume create freshrss-data
sudo docker run -d --restart unless-stopped --log-opt max-size=10m \
-v freshrss-data:/var/www/FreshRSS/data \
-e 'CRON_MIN=4,34' \
+ -e TZ=Europe/Paris \
--net freshrss-network \
--label traefik.port=80 \
--label traefik.frontend.rule='Host:freshrss.example.net' \
@@ -74,6 +75,7 @@ sudo docker run -d --restart unless-stopped --log-opt max-size=10m \
--name freshrss freshrss/freshrss
```
+* Replace `TZ=Europe/Paris` by your [server timezone](http://php.net/timezones), or remove the line to use `UTC`.
* If you cannot have FreshRSS at the root of a dedicated domain, update the command above according to the following model:
`--label traefik.frontend.rule='Host:freshrss.example.net;PathPrefixStrip:/FreshRSS/' \`
* You may remove the `--label traefik.*` lines if you do not use Træfik.
@@ -205,6 +207,27 @@ sudo docker run -d --restart unless-stopped --log-opt max-size=10m \
## More deployment options
+### Custom Apache configuration (advanced users)
+
+Changes in Apache `.htaccess` files are applied when restarting the container.
+In particular, if you want FreshRSS to use HTTP-based login (instead of the easier Web form login), you can mount your own `./FreshRSS/p/i/.htaccess`:
+
+```
+sudo docker run ...
+ -v /your/.htaccess:/var/www/FreshRSS/p/i/.htaccess \
+ -v /your/.htpasswd:/var/www/FreshRSS/data/.htpasswd \
+ ...
+ --name freshrss freshrss/freshrss
+```
+
+Example of `/your/.htaccess` referring to `/your/.htpasswd`:
+```
+AuthUserFile /var/www/FreshRSS/data/.htpasswd
+AuthName "FreshRSS"
+AuthType Basic
+Require valid-user
+```
+
### Example with [docker-compose](https://docs.docker.com/compose/)
A [docker-compose.yml](docker-compose.yml) file is given as an example, using PostgreSQL. In order to use it, you have to adapt:
diff --git a/Docker/entrypoint.sh b/Docker/entrypoint.sh
index d4e1808bc..528388073 100755
--- a/Docker/entrypoint.sh
+++ b/Docker/entrypoint.sh
@@ -5,6 +5,8 @@ php -f ./cli/prepare.php > /dev/null
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#" {} \;
+
if [ -n "$CRON_MIN" ]; then
sed -r -i "\#FreshRSS#s#^[^ ]+ #$CRON_MIN #" /var/spool/cron/crontabs/root
fi