From 638f839f3c5cc320ea523e446e498e0792a6a3c0 Mon Sep 17 00:00:00 2001 From: Blallo Date: Tue, 31 Jul 2018 16:36:00 +0200 Subject: [PATCH] docker-compose quasi-working --- docker-compose.yml | 39 ++++++++ docker/Dockerfile-tt-rss | 10 ++ docker/config.php | 199 +++++++++++++++++++++++++++++++++++++++ docker/rss.conf | 33 +++++++ 4 files changed, 281 insertions(+) create mode 100644 docker-compose.yml create mode 100644 docker/Dockerfile-tt-rss create mode 100644 docker/config.php create mode 100644 docker/rss.conf diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..2ae0fb5 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,39 @@ +version: "3.6" + +services: + db: + image: postgres:10 + volumes: + - postgres_data:/var/lib/postgresql/data + environment: + - POSTGRES_USER=ttrss + - POSTGRES_PASSWORD=password-dev + - POSTGRES_DB=ttrss + + tt-rss: + image: feedati/tt-rss:latest + build: + context: . + dockerfile: ./docker/Dockerfile-tt-rss + volumes: + - ./tt-rss:/var/www/html/tt-rss + - ./docker/config.php:/var/www/html/tt-rss/config.php:ro + ports: + - 8000:80 + + rss-bridge: + image: feedati/rss-bridge:latest + build: + context: ./rss-bridge/ + ports: + - 8001:80 + + webserver: + image: nginx:latest + volumes: + - ./docker/rss.conf:/etc/nginx/conf.d/default.conf:ro + ports: + - 80:80 + +volumes: + postgres_data: diff --git a/docker/Dockerfile-tt-rss b/docker/Dockerfile-tt-rss new file mode 100644 index 0000000..ac43b97 --- /dev/null +++ b/docker/Dockerfile-tt-rss @@ -0,0 +1,10 @@ +FROM php:7.2-apache + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && apt-get install --no-install-recommends -y libpq-dev \ + && docker-php-ext-install pdo pgsql pdo_pgsql \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +RUN mkdir /var/www/html/tt-rss \ + && chown www-data:www-data /var/www/html/tt-rss +COPY tt-rss/ /var/www/html/ diff --git a/docker/config.php b/docker/config.php new file mode 100644 index 0000000..5698b96 --- /dev/null +++ b/docker/config.php @@ -0,0 +1,199 @@ + System), syslog - logs to system log. + // Setting this to blank uses PHP logging (usually to http server + // error.log). + // Note that feed updating daemons don't use this logging facility + // for normal output. + + define('CONFIG_VERSION', 26); + // Expected config version. Please update this option in config.php + // if necessary (after migrating all new options from this file). + + // vim:ft=php diff --git a/docker/rss.conf b/docker/rss.conf new file mode 100644 index 0000000..63f9ac0 --- /dev/null +++ b/docker/rss.conf @@ -0,0 +1,33 @@ +server { + listen 80; + server_name _; + + location /tt-rss { + try_files $uri @tt-rss; + } + location /rss-bridge { + try_files $uri @rss-bridge; + } + + location @tt-rss { + rewrite ^/tt-rss/(.*)$ /$1 break; + resolver 127.0.0.11 ipv6=off; + proxy_pass http://tt-rss/$request_uri; + proxy_read_timeout 60s; + proxy_connect_timeout 4s; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } + + location @rss-bridge { + rewrite ^/rss-bridge/(.*)$ /$1 break; + resolver 127.0.0.11 ipv6=off; + proxy_pass http://rss-bridge/$request_uri; + proxy_read_timeout 60s; + proxy_connect_timeout 4s; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } +}