diff --git a/Dockerfile b/Dockerfile index 8c2eec3..505eab9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,30 +1,30 @@ -FROM alpine:3.8 - -# https://git.tt-rss.org/fox/tt-rss/wiki/InstallationNotes -# https://github.com/clue/docker-ttrss/blob/master/Dockerfile -# https://github.com/linuxserver/docker-tt-rss/blob/master/Dockerfile - -ADD https://git.tt-rss.org/fox/tt-rss/archive/18.12.tar.gz /tmp/ttrss.tar.gz - -RUN tar -xzf /tmp/ttrss.tar.gz +FROM nginx:1.15.7-alpine RUN \ - echo "**** install packages ****" && \ - apk add --no-cache \ - curl \ - php7-apcu \ - php7-curl \ - php7-dom \ - php7-gd \ - php7-iconv \ - php7-intl \ - php7-mcrypt \ - php7-pcntl \ - php7-pdo_pgsql \ - php7-pgsql \ - php7-posix \ - tar && \ - echo "**** link php7 to php ****" && \ - ln -sf /usr/bin/php7 /usr/bin/php + apk add --no-cache \ + curl \ + php7-apcu \ + php7-curl \ + php7-dom \ + php7-gd \ + php7-iconv \ + php7-intl \ + php7-mcrypt \ + php7-pcntl \ + php7-pdo_pgsql \ + php7-pgsql \ + php7-posix \ + php7-fpm \ + tar +RUN ln -sf /usr/bin/php7 /usr/bin/php -#copy config + delete install.php +EXPOSE 80 443 + +COPY nginx.conf /etc/nginx/conf.d/default.conf + +ADD https://git.tt-rss.org/fox/tt-rss/archive/18.12.tar.gz /tmp/ttrss.tar.gz +RUN tar -xzf /tmp/ttrss.tar.gz -C /var/lib + +COPY config.php /var/lib/tt-rss/config.php + +CMD php-fpm7 && nginx -g "daemon off;" diff --git a/config.php b/config.php index 4032553..1ddffd4 100644 --- a/config.php +++ b/config.php @@ -3,12 +3,14 @@ // *** Database configuration (important!) *** // ******************************************* - define('DB_TYPE', "pgsql"); // or mysql - define('DB_HOST', "localhost"); - define('DB_USER', "fox"); - define('DB_NAME', "fox"); - define('DB_PASS', "XXXXXX"); - define('DB_PORT', ''); // usually 5432 for PostgreSQL, 3306 for MySQL + $postgres_uri = getenv('DATABASE_URL'); + preg_match('^postgres://(.*):(.*)@(.*):(.*)/(.*)$', getenv('DATABASE_URL'), $matches) + define('DB_TYPE', "pgsql"); + define('DB_HOST', $matches[3]); + define('DB_USER', $matches[1]); + define('DB_NAME', $matches[5]); + define('DB_PASS', $matches[2]); + define('DB_PORT', $matches[4]); define('MYSQL_CHARSET', 'UTF8'); // Connection charset for MySQL. If you have a legacy database and/or experience @@ -18,18 +20,18 @@ // *** Basic settings (important!) *** // *********************************** - define('SELF_URL_PATH', 'http://example.org/tt-rss/'); + define('SELF_URL_PATH', 'https://feeds.mais-h.eu'); // Full URL of your tt-rss installation. This should be set to the // location of tt-rss directory, e.g. http://example.org/tt-rss/ // You need to set this option correctly otherwise several features // including PUSH, bookmarklets and browser integration will not work properly. - define('SINGLE_USER_MODE', false); + define('SINGLE_USER_MODE', true); // Operate in single user mode, disables all functionality related to // multiple users and authentication. Enabling this assumes you have // your tt-rss directory protected by other means (e.g. http auth). - define('SIMPLE_UPDATE_MODE', false); + define('SIMPLE_UPDATE_MODE', true); // Enables fallback update mode where tt-rss tries to update feeds in // background while tt-rss is open in your browser. // If you don't have a lot of feeds and don't want to or can't run diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..e4ce8ef --- /dev/null +++ b/nginx.conf @@ -0,0 +1,18 @@ +server { + listen 80; + root /var/lib/tt-rss; + index index.html index.htm index.php; + + location / { + try_files $uri $uri/ /index.html /index.php?$args =404; + } + + location ~ \.php$ { + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_pass 127.0.0.1:9000; + fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; + fastcgi_param DOCUMENT_ROOT $realpath_root; + fastcgi_index index.php; + include /etc/nginx/fastcgi_params; + } +}