From ddc393a36a7d7647f57f182a72b403ece1620df4 Mon Sep 17 00:00:00 2001 From: Wonderfall Date: Mon, 5 Jun 2017 22:16:17 +0200 Subject: [PATCH] add FreshRSS image --- freshrss/Dockerfile | 29 ++++++++++++++++ freshrss/README.md | 23 +++++++++++++ .../rootfs/nginx/sites-enabled/nginx.conf | 33 +++++++++++++++++++ freshrss/rootfs/usr/local/bin/run.sh | 7 ++++ 4 files changed, 92 insertions(+) create mode 100644 freshrss/Dockerfile create mode 100644 freshrss/README.md create mode 100644 freshrss/rootfs/nginx/sites-enabled/nginx.conf create mode 100644 freshrss/rootfs/usr/local/bin/run.sh diff --git a/freshrss/Dockerfile b/freshrss/Dockerfile new file mode 100644 index 0000000..a450535 --- /dev/null +++ b/freshrss/Dockerfile @@ -0,0 +1,29 @@ +FROM wonderfall/nginx-php:7.1 + +ARG FRESHRSS_VER=1.7.0 + +ENV UID=991 GID=991 \ + UPLOAD_MAX_SIZE=10M \ + MEMORY_LIMIT=128M + +RUN apk -U add --no-cache \ + tar \ + libressl \ + ca-certificates \ + && mkdir freshrss && cd freshrss \ + && wget -qO- https://github.com/FreshRSS/FreshRSS/archive/${FRESHRSS_VER}.tar.gz | tar xz --strip 1 \ + && mv data data_tmp + +COPY rootfs / + +RUN chmod +x /usr/local/bin/run.sh /etc/s6.d/*/* /etc/s6.d/.s6-svscan/* + +VOLUME /freshrss/data /php/session + +EXPOSE 8888 + +LABEL maintainer="Wonderfall " \ + description="A free, self-hostable aggregator" \ + version="FreshRSS ${FRESHRSS_VER}" + +CMD ["run.sh"] diff --git a/freshrss/README.md b/freshrss/README.md new file mode 100644 index 0000000..a58fab5 --- /dev/null +++ b/freshrss/README.md @@ -0,0 +1,23 @@ +## wonderfall/privatebin + +Paste securely. + +#### Features +- Based on Alpine Linux (wonderfall/nginx-php image) +- Uses [PrivateBin](https://github.com/PrivateBin/PrivateBin), originally a fork of zerobin by elrido. +- Bundled with nginx and PHP7.1. + +#### Build-time variables +- **PRIVATEBIN_VER** : version of PrivateBin + +#### Environment variables +- **UID** : zerobin user id +- **GID** : zerobin group id +- **MEMORY_LIMIT** : php memory limit *(default : 128M)* +- **UPLOAD_MAX_SIZE** : maximum upload size *(default : 10M)* + +#### Volumes +- **/privatebin/data** + +#### Ports +- **8888** [(reverse proxy!)](https://github.com/hardware/mailserver/wiki/Reverse-proxy-configuration) diff --git a/freshrss/rootfs/nginx/sites-enabled/nginx.conf b/freshrss/rootfs/nginx/sites-enabled/nginx.conf new file mode 100644 index 0000000..69977bc --- /dev/null +++ b/freshrss/rootfs/nginx/sites-enabled/nginx.conf @@ -0,0 +1,33 @@ +server { + listen 8888; + root /freshrss; + index index.php index.html; + + location ~* \.(jpg|jpeg|gif|css|png|js|map|woff|woff2|ttf|svg|eot)$ { + expires 30d; + access_log off; + } + + location ~ ^/(data|cfg|tmp) { + deny all; + } + + location ~* /(.*)\.(?:markdown|md|twig|yaml|yml|ht|htaccess|ini)$ { + deny all; + } + + location ~ /\. { + deny all; + } + + location / { + try_files $uri $uri/ /index.php; + } + + location ~ \.php$ { + fastcgi_index index.php; + fastcgi_pass unix:/php/run/php-fpm.sock; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include /nginx/conf/fastcgi_params; + } +} diff --git a/freshrss/rootfs/usr/local/bin/run.sh b/freshrss/rootfs/usr/local/bin/run.sh new file mode 100644 index 0000000..c7c9954 --- /dev/null +++ b/freshrss/rootfs/usr/local/bin/run.sh @@ -0,0 +1,7 @@ +#!/bin/sh +sed -i -e "s//$UPLOAD_MAX_SIZE/g" /nginx/conf/nginx.conf /php/etc/php-fpm.conf \ + -e "s//$MEMORY_LIMIT/g" /php/etc/php-fpm.conf + +[ ! "$(ls -A /freshrss/data)" ] && cp -R /freshrss/data_tmp/* /freshrss/data/ +chown -R $UID:$GID /freshrss /nginx /php /tmp /etc/s6.d +exec su-exec $UID:$GID /bin/s6-svscan /etc/s6.d