1
0
Fork 0
mirror of https://git.tt-rss.org/fox/ttrss-docker-compose synced 2025-06-10 08:39:51 +02:00

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

This commit is contained in:
Andrew Dolgov 2020-03-13 14:52:36 +03:00
commit 2cdf7937d0
8 changed files with 88 additions and 24 deletions

View file

@ -2,21 +2,19 @@
The idea is to provide tt-rss working (and updating) out of the box with minimal fuss. 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 This setup is still WIP. Some features may be unimplemented or broken. Check the following
before deploying: before deploying:
- [TODO](https://git.tt-rss.org/fox/ttrss-docker-compose/wiki/TODO) - [TODO](https://git.tt-rss.org/fox/ttrss-docker-compose/wiki/TODO)
- [FAQ](https://git.tt-rss.org/fox/ttrss-docker-compose/wiki#faq) - [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: General outline of the configuration is as follows:
- separate containers (frontend: caddy, database: pgsql, app and updater: php/fpm) - separate containers (frontend: caddy, database: pgsql, app and updater: php/fpm)
- tt-rss latest git master source baked into container on build - 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 - 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 - ``config.php`` is generated if it is missing
- database schema is installed automatically 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 ### 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 ```sh
git clone https://git.tt-rss.org/fox/ttrss-docker-compose.git ttrss-docker git clone https://git.tt-rss.org/fox/ttrss-docker-compose.git ttrss-docker

View file

@ -73,6 +73,16 @@ services:
# depends_on: # depends_on:
# - app # - 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: volumes:
db: db:
app: app:

View file

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

View file

@ -1,24 +1,10 @@
#!/bin/sh #!/bin/sh
DST_DIR=/src/tt-rss 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
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 --branch master --depth 1 https://git.tt-rss.org/fox/tt-rss.git $DST_DIR
git clone https://git.tt-rss.org/fox/ttrss-nginx-xaccel.git $DST_DIR/plugins.local/nginx_xaccel git clone --branch master --depth 1 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
mkdir -p /var/www mkdir -p /var/www

View file

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

View file

@ -81,6 +81,17 @@ services:
depends_on: depends_on:
- app - 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: volumes:
db: db:
app: app:

3
src/web-nginx/Dockerfile Normal file
View file

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

55
src/web-nginx/nginx.conf Normal file
View file

@ -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;
}
}
}