2020-01-24 09:19:14 +03:00
# Dockerized tt-rss using docker-compose
2019-11-15 15:51:55 +03:00
2019-11-16 11:20:54 +00:00
The idea is to provide tt-rss working (and updating) out of the box with minimal fuss.
2019-11-15 17:08:40 +03:00
2020-12-31 05:36:35 +00:00
**This setup uses official prebuilt images from Docker Hub. Note that images are only available for Linux/amd64.**
2020-01-25 12:14:30 +00:00
2020-01-23 08:04:27 +03:00
- [TODO ](https://git.tt-rss.org/fox/ttrss-docker-compose/wiki/TODO )
- [FAQ ](https://git.tt-rss.org/fox/ttrss-docker-compose/wiki#faq )
General outline of the configuration is as follows:
2019-11-15 15:51:55 +03:00
2020-12-31 10:05:28 +00:00
- separate containers (frontend: nginx, database: pgsql, app and updater: php/fpm)
2020-01-23 13:59:57 +03:00
- tt-rss latest git master source baked into container on build
2020-01-25 12:14:30 +00:00
- images are pulled from [Docker Hub ](https://hub.docker.com/u/cthulhoo ) (automatically built and published on tt-rss master source update)
2020-01-23 13:59:57 +03:00
- working copy is stored on (and rsynced over on restart) a persistent volume so plugins, etc. could be easily added
2020-01-23 08:04:27 +03:00
- database schema is installed automatically if it is missing
2020-12-31 10:05:28 +00:00
- nginx has its http port exposed to the outside
2021-01-31 16:04:00 +03:00
- optional SSL support via Caddy w/ automatic letsencrypt certificates (deprecated)
2020-01-22 16:40:31 +03:00
- feed updates are handled via update daemon started in a separate container (updater)
2020-09-30 12:36:20 +03:00
- optional backups container which performs tt-rss database backup once a week
2019-11-15 15:51:55 +03:00
2019-11-15 21:30:50 +03:00
### Installation
2020-01-24 20:13:56 +00:00
#### 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)
2019-11-15 21:30:50 +03:00
2020-01-23 08:10:40 +03:00
```sh
2020-01-23 13:59:57 +03:00
git clone https://git.tt-rss.org/fox/ttrss-docker-compose.git ttrss-docker
cd ttrss-docker
2020-01-24 09:12:41 +03:00
git checkout static-dockerhub
2019-11-15 21:30:50 +03:00
```
2020-01-24 09:12:41 +03:00
You're interested in ``docker-compose.yml`` stored in root directory, as opposed to ``src` `.
2021-01-31 16:04:00 +03:00
Latter directory is used to build images for publishing on Docker Hub. Use it if you
2020-01-24 09:12:41 +03:00
want to build your own containers.
2020-01-19 12:54:24 +03:00
#### Edit configuration files:
2019-11-15 21:30:50 +03:00
2020-01-19 12:54:24 +03:00
Copy ``.env-dist`` to ``.env` ` and edit any relevant variables you need changed.
2020-12-31 08:50:16 +00:00
You will likely have to change ``SELF_URL_PATH` ` which should equal fully qualified tt-rss
2019-11-15 21:30:50 +03:00
URL as seen when opening it in your web browser. If this field is set incorrectly, you will
likely see the correct value in the tt-rss fatal error message.
2020-12-31 08:50:16 +00:00
By default, `web` container binds to **localhost** port **8280** . If you want the container to be
2020-01-19 12:54:24 +03:00
accessible on the net, without using a reverse proxy sharing same host, you will need to
remove ``127.0.0.1:`` from ``HTTP_PORT`` variable in ``.env` `.
2020-12-31 08:50:16 +00:00
Please don't rename the services inside `docker-compose.yml` unless you know what you're doing. Web container expects application container to be named `app` , if you rename it and it's not accessible via Docker DNS as `http://app` you will run into 502 errors on startup.
2021-02-23 16:32:47 +03:00
Main configuration file (`config.php` ) is rewritten on startup, don't edit it manually. Use [environment variables ](https://git.tt-rss.org/fox/ttrss-docker-compose/wiki#how-do-i-set-global-configuration-options ) or `config.d` snippets to customize it.
2021-01-31 16:04:00 +03:00
2020-01-24 09:12:41 +03:00
#### Pull and start the container
2019-11-15 18:50:21 +00:00
2020-01-23 08:10:40 +03:00
```sh
2020-12-31 08:54:21 +00:00
docker-compose pull & & docker-compose up -d
2020-01-23 08:10:40 +03:00
```
2019-11-15 21:30:50 +03:00
2020-01-24 09:12:41 +03:00
See ``docker-compose` ` documentation for more information and available options.
2019-11-15 21:30:50 +03:00
### Updating
2020-01-24 09:12:41 +03:00
You will need to pull a fresh image from Docker Hub to update tt-rss source code. Working copy
2020-01-23 13:59:57 +03:00
will be synchronized on startup.
If database needs to be updated, tt-rss will prompt you to do so on next page refresh.
2019-11-15 21:30:50 +03:00
2019-11-16 11:23:43 +00:00
#### Updating container scripts
1. Stop the containers: ``docker-compose down && docker-compose rm` `
2020-11-22 18:32:21 +00:00
2. Update scripts from git: ``git pull origin static-dockerhub`` and apply any necessary modifications to ``.env` `, etc.
2020-01-24 09:12:41 +03:00
3. Pull fresh images and start the containers: ``docker-compose pull && docker-compose up` `
2019-11-16 11:23:43 +00:00
2019-11-15 19:03:11 +00:00
### Suggestions / bug reports
2019-11-15 21:33:02 +03:00
2019-11-16 10:19:36 +00:00
- [Forum thread ](https://community.tt-rss.org/t/docker-compose-tt-rss/2894 )