Merge branch 'static-dockerhub' of git.tt-rss.org:fox/ttrss-docker-compose into static-dockerhub

remotes/origin/pgsql-count-bits-12
Andrew Dolgov 5 years ago
commit 2cdf7937d0

@ -2,21 +2,19 @@
The idea is to provide tt-rss working (and updating) out of the box with minimal fuss.
**This compose setup uses prebuilt images from Docker Hub.**
This setup is still WIP. Some features may be unimplemented or broken. Check the following
before deploying:
- [TODO](https://git.tt-rss.org/fox/ttrss-docker-compose/wiki/TODO)
- [FAQ](https://git.tt-rss.org/fox/ttrss-docker-compose/wiki#faq)
**EXPERIMENTAL, DON'T USE IN PRODUCTION**
**This is an alternative version which uses prebuilt images from Docker Hub.**
General outline of the configuration is as follows:
- separate containers (frontend: caddy, database: pgsql, app and updater: php/fpm)
- tt-rss latest git master source baked into container on build
- images are pulled from [Docker Hub](https://hub.docker.com/u/cthulhoo) (automatically published on tt-rss master source update)
- images are pulled from [Docker Hub](https://hub.docker.com/u/cthulhoo) (automatically built and published on tt-rss master source update)
- working copy is stored on (and rsynced over on restart) a persistent volume so plugins, etc. could be easily added
- ``config.php`` is generated if it is missing
- database schema is installed automatically if it is missing
@ -26,7 +24,7 @@ General outline of the configuration is as follows:
### Installation
#### Get ``docker-compose.yml`` and ``.env-dist``
#### Get [docker-compose.yml](https://git.tt-rss.org/fox/ttrss-docker-compose/src/static-dockerhub/docker-compose.yml) and [.env-dist](https://git.tt-rss.org/fox/ttrss-docker-compose/src/static-dockerhub/.env-dist)
```sh
git clone https://git.tt-rss.org/fox/ttrss-docker-compose.git ttrss-docker

@ -73,6 +73,16 @@ services:
# depends_on:
# - app
# web-nginx:
# image: cthulhoo/ttrss-web-nginx
# restart: unless-stopped
# ports:
# - ${HTTP_PORT}:80
# volumes:
# - app:/var/www/html:ro
# depends_on:
# - app
volumes:
db:
app:

@ -5,7 +5,7 @@ RUN apk add --no-cache php7 php7-fpm \
php7-pdo php7-gd php7-pgsql php7-pdo_pgsql php7-mbstring \
php7-intl php7-xml php7-curl php7-session \
php7-dom php7-fileinfo php7-json \
php7-pcntl php7-posix \
php7-pcntl php7-posix php7-zip \
git postgresql-client sudo rsync
ADD startup.sh /

@ -1,24 +1,10 @@
#!/bin/sh
DST_DIR=/src/tt-rss
SRC_REPO=https://git.tt-rss.org/fox/tt-rss.git
if [ ! -d $DST_DIR ]; then
mkdir -p $DST_DIR
git clone $SRC_REPO $DST_DIR
else
cd $DST_DIR && \
git config core.filemode false && \
git pull origin master
fi
if [ ! -d $DST_DIR/plugins.local/nginx_xaccel ]; then
git clone https://git.tt-rss.org/fox/ttrss-nginx-xaccel.git $DST_DIR/plugins.local/nginx_xaccel
else
cd $DST_DIR/plugins.local/nginx_xaccel && \
git config core.filemode false && \
git pull origin master
fi
git clone --branch master --depth 1 https://git.tt-rss.org/fox/tt-rss.git $DST_DIR
git clone --branch master --depth 1 https://git.tt-rss.org/fox/ttrss-nginx-xaccel.git $DST_DIR/plugins.local/nginx_xaccel
mkdir -p /var/www

@ -30,6 +30,7 @@ else
--exclude plugins.local \
--exclude templates.local \
--exclude themes.local \
--exclude config.php \
$SRC_DIR/ $DST_DIR/
rsync -aP --delete \

@ -81,6 +81,17 @@ services:
depends_on:
- app
web-nginx:
image: cthulhoo/ttrss-web-nginx:latest
build: ./web-nginx
restart: unless-stopped
ports:
- ${HTTP_PORT}:80
volumes:
- app:/var/www/html:ro
depends_on:
- app
volumes:
db:
app:

@ -0,0 +1,3 @@
FROM nginx:alpine
COPY nginx.conf /etc/nginx/nginx.conf

@ -0,0 +1,55 @@
worker_processes auto;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /dev/stdout;
error_log /dev/stderr warn;
sendfile on;
index index.php;
upstream app {
server app:9000;
}
server {
listen 80;
root /var/www/html;
location /tt-rss/cache {
aio threads;
internal;
}
location ~ \.php$ {
# regex to split $uri to $fastcgi_script_name and $fastcgi_path
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
# Check that the PHP script exists before passing it
try_files $fastcgi_script_name =404;
# Bypass the fact that try_files resets $fastcgi_path_info
# see: http://trac.nginx.org/nginx/ticket/321
set $path_info $fastcgi_path_info;
fastcgi_param PATH_INFO $path_info;
fastcgi_index index.php;
include fastcgi.conf;
fastcgi_pass app;
}
location / {
try_files $uri $uri/ =404;
}
}
}
Loading…
Cancel
Save