Initial commit.

This commit is contained in:
andy 2014-05-13 21:54:26 +02:00
parent 2213f3cd0d
commit ff6c069a85
5 changed files with 38 additions and 16 deletions

View File

@ -1,5 +1,6 @@
FROM ubuntu
MAINTAINER Christian Lück <christian@lueck.tv>
# Based on work of Christian Lück <christian@lueck.tv>
MAINTAINER Andreas Löffler <andy@x86dev.com>
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y \
nginx git supervisor php5-fpm php5-cli php5-curl php5-gd php5-json \
@ -11,11 +12,27 @@ ADD ttrss.nginx.conf /etc/nginx/sites-available/ttrss
RUN ln -s /etc/nginx/sites-available/ttrss /etc/nginx/sites-enabled/ttrss
RUN rm /etc/nginx/sites-enabled/default
# patch php5-fpm configuration so that it does not daemonize itself. This is
# needed because supervisord can watch its state
RUN sed -i -e "s/;daemonize\s*=\s*yes/daemonize = no/g" /etc/php5/fpm/php-fpm.conf
# patch the php-fpm's listening method to _always_ use a unix socket
# note: if not done correctly this will result in a "502 Bad Gateway" error
# (see /var/log/nginx/error.log for more information then)
RUN sed -i -e "s/listen\s*=.*/listen = \/var\/run\/php5-fpm.sock/g" /etc/php5/fpm/pool.d/www.conf
# install ttrss and patch configuration
RUN git clone https://github.com/gothfox/Tiny-Tiny-RSS.git /var/www
WORKDIR /var/www
RUN git clone https://github.com/gothfox/Tiny-Tiny-RSS.git /var/www/ttrss
WORKDIR /var/www/ttrss
RUN cp config.php-dist config.php
RUN sed -i -e "/'SELF_URL_PATH'/s/ '.*'/ 'http:\/\/localhost\/'/" config.php
# install feedly theme
RUN git clone https://github.com/levito/tt-rss-feedly-theme.git
RUN ln -s /var/www/ttrss/tt-rss-feedly-theme/feedly /var/www/ttrss/themes/feedly
RUN ln -s /var/www/ttrss/tt-rss-feedly-theme/feedly.css /var/www/ttrss/themes/feedly.css
# apply ownership of ttrss + addons to www-data
RUN chown www-data:www-data -R /var/www
# expose only nginx HTTP port
@ -30,4 +47,3 @@ ENV DB_PASS ttrss
ADD configure-db.php /configure-db.php
ADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf
CMD php /configure-db.php && supervisord -c /etc/supervisor/conf.d/supervisord.conf

View File

@ -1,5 +1,12 @@
# docker-ttrss
Note: This Dockerfile is a modified version of https://github.com/clue/docker-ttrss.git
which adds some features, plugins and themes I wanted to have in my own tt-rss setup.
Tiny Tiny RSS' root now is in the subdirectory ttrss, e.g. http://<yourhost>/ttrss
Feel free to tweak this further to your likings.
This docker image allows you to run the [Tiny Tiny RSS](http://tt-rss.org) feed reader.
Keep your feed history to yourself and access your RSS and atom feeds from everywhere.
You can access it through an easy to use webinterface on your desktop, your mobile browser
@ -20,7 +27,7 @@ And because this docker image is available as a [trusted build on the docker ind
using it is as simple as launching this Tiny Tiny RSS installation linked to your fresh database:
```bash
$ docker run -d --link $DB:db -p 80:80 clue/ttrss
$ docker run -d --link $DB:db -p 80:80 --name ttrss <this-image>
```
Running this command for the first time will download the image automatically.
@ -57,7 +64,7 @@ any, as long as is exposes its database port (5432) to the outside.
Example:
```bash
$ sudo docker run -d --name=tinystore nornagon/postgres
$ sudo docker run -d --name=ttrss-data nornagon/postgres
```
#### Testing ttrss in foreground
@ -67,7 +74,7 @@ This is particular useful for your initial database setup, as errors get reporte
the console and further execution will halt.
```bash
$ sudo docker run -it --link tinystore:db -p 80:80 clue/ttrss
$ sudo docker run -it --link ttrss-data:db -p 80:80 --name ttrss <this-image>
```
##### Database configuration
@ -103,5 +110,5 @@ Remaining arguments can be passed just like before, the following is the recomme
minimum:
```bash
$ sudo docker run -d --link tinystore:db -p 80:80 clue/ttrss
$ sudo docker run -d --link ttrss-data:db -p 80:80 --name ttrss <this-image>
```

View File

@ -3,7 +3,7 @@
$ename = 'DB';
$eport = 5432;
$confpath = '/var/www/config.php';
$confpath = '/var/www/ttrss/config.php';
// check DB_NAME, which will be set automatically for a linked "db" container
if (!env($ename . '_PORT', '')) {
@ -34,12 +34,12 @@ if (!dbcheck($config)) {
$super['DB_NAME'] = null;
$super['DB_USER'] = env($ename . '_ENV_USER', 'docker');
$super['DB_PASS'] = env($ename . '_ENV_PASS', $super['DB_USER']);
$pdo = dbconnect($super);
$pdo->exec('CREATE ROLE ' . ($config['DB_USER']) . ' WITH LOGIN PASSWORD ' . $pdo->quote($config['DB_PASS']));
$pdo->exec('CREATE DATABASE ' . ($config['DB_NAME']) . ' WITH OWNER ' . ($config['DB_USER']));
unset($pdo);
if (dbcheck($config)) {
echo 'Database login created and confirmed' . PHP_EOL;
} else {
@ -73,11 +73,11 @@ file_put_contents($confpath, $contents);
function env($name, $default = null)
{
$v = getenv($name) ?: $default;
if ($v === null) {
error('The env ' . $name . ' does not exist');
}
return $v;
}

View File

@ -2,13 +2,13 @@
nodaemon=true
[program:php5-fpm]
command=/usr/sbin/php5-fpm --nodaemonize
command=/usr/sbin/php5-fpm
[program:nginx]
command=/usr/sbin/nginx -g "daemon off;"
[program:ttrss-update-daemon]
command=/usr/bin/php /var/www/update_daemon2.php
command=/usr/bin/php /var/www/ttrss/update_daemon2.php
user=www-data
stdout_logfile=/tmp/%(program_name)s.stdout
stderr_logfile=/tmp/%(program_name)s.stderr

View File

@ -15,4 +15,3 @@ server {
include fastcgi_params;
}
}