mirror of
				https://git.tt-rss.org/fox/ttrss-docker-compose
				synced 2025-10-31 14:14:12 +01:00 
			
		
		
		
	Update Home
							parent
							
								
									78b9040d29
								
							
						
					
					
						commit
						669c437e89
					
				
					 1 changed files with 329 additions and 342 deletions
				
			
		
							
								
								
									
										671
									
								
								Home.md
									
										
									
									
									
								
							
							
						
						
									
										671
									
								
								Home.md
									
										
									
									
									
								
							|  | @ -1,342 +1,329 @@ | ||||||
| ## Installation | ## Installation | ||||||
| 
 | 
 | ||||||
| See [README.md](https://git.tt-rss.org/fox/ttrss-docker-compose.git/tree/README.md) | See [README.md](https://git.tt-rss.org/fox/ttrss-docker-compose.git/tree/README.md) | ||||||
| 
 | 
 | ||||||
| ## FAQ | ## FAQ | ||||||
| 
 | 
 | ||||||
| ### I'm using docker-compose.override.yml and now I'm getting schema update (and other) strange issues | ### I'm using docker-compose.override.yml and now I'm getting schema update (and other) strange issues | ||||||
| 
 | 
 | ||||||
| Alternatively, you've changed something related to `/var/www/html/tt-rss` in `docker-compose.yml`. | Alternatively, you've changed something related to `/var/www/html/tt-rss` in `docker-compose.yml`. | ||||||
| 
 | 
 | ||||||
| You screwed up your docker setup somehow, so tt-rss can't update itself to the persistent storage location on startup (this is just an example of one issue, there could be many others). | You screwed up your docker setup somehow, so tt-rss can't update itself to the persistent storage location on startup (this is just an example of one issue, there could be many others). | ||||||
| 
 | 
 | ||||||
| Related threads: | Related threads: | ||||||
| 
 | 
 | ||||||
|  - https://community.tt-rss.org/t/schema-version-is-wrong-please-upgrade-the-database/5150 |  - https://community.tt-rss.org/t/schema-version-is-wrong-please-upgrade-the-database/5150 | ||||||
|  - https://community.tt-rss.org/t/closed-problem-with-database-schema-update-to-the-latest-version-146-to-145/5138/7?u=fox |  - https://community.tt-rss.org/t/closed-problem-with-database-schema-update-to-the-latest-version-146-to-145/5138/7?u=fox | ||||||
| 
 | 
 | ||||||
| Either undo your changes or figure how to fix the problem you created and everything should work properly. | Either undo your changes or figure how to fix the problem you created and everything should work properly. | ||||||
| 
 | 
 | ||||||
| ### How do I make it run without /tt-rss/ in the URL, i.e. at website root? | ### How do I make it run without /tt-rss/ in the URL, i.e. at website root? | ||||||
| 
 | 
 | ||||||
| You can't, not with this particular setup. I wanted to support both sharing a single domain with other applications and running on a dedicated domain. This was the easiest way to implement it. | You can't, not with this particular setup. I wanted to support both sharing a single domain with other applications and running on a dedicated domain. This was the easiest way to implement it. | ||||||
| 
 | 
 | ||||||
| Location is entirely cosmetic so I've decided that adding complexity to optionally strip it wasn't worth it. If you disagree and can't stand ``/tt-rss/`` in the URL, you'll have to modify things a bit to get rid of it. | Location is entirely cosmetic so I've decided that adding complexity to optionally strip it wasn't worth it. If you disagree and can't stand ``/tt-rss/`` in the URL, you'll have to modify things a bit to get rid of it. | ||||||
| 
 | 
 | ||||||
| ### How do I apply configuration options? | ### How do I apply configuration options? | ||||||
| 
 | 
 | ||||||
| There are two sets of options you can change through the environment - options specific to tt-rss (those are prefixed with `TTRSS_`) and options affecting container behavior. | There are two sets of options you can change through the environment - options specific to tt-rss (those are prefixed with `TTRSS_`) and options affecting container behavior. | ||||||
| 
 | 
 | ||||||
| #### Options specific to tt-rss | #### Options specific to tt-rss | ||||||
| 
 | 
 | ||||||
| For example, to set tt-rss global option `SELF_URL_PATH`, add the following to `.env`: | For example, to set tt-rss global option `SELF_URL_PATH`, add the following to `.env`: | ||||||
| 
 | 
 | ||||||
| ```ini | ```ini | ||||||
| TTRSS_SELF_URL_PATH=http://example.com/tt-rss | TTRSS_SELF_URL_PATH=http://example.com/tt-rss | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| Don't use quotes around values. Note the prefix (`TTRSS_`) before the value. | Don't use quotes around values. Note the prefix (`TTRSS_`) before the value. | ||||||
| 
 | 
 | ||||||
| Look [here](https://tt-rss.org/wiki/GlobalConfig) for more information. | Look [here](https://tt-rss.org/wiki/GlobalConfig) for more information. | ||||||
| 
 | 
 | ||||||
| #### Container options | #### Container options | ||||||
| 
 | 
 | ||||||
| Some options, but not all, are mentioned in `.env-dist`. You can see all available options in the Dockerfile: | Some options, but not all, are mentioned in `.env-dist`. You can see all available options in the Dockerfile: | ||||||
| 
 | 
 | ||||||
| - https://dev.tt-rss.org/fox/ttrss-docker-compose/src/branch/static-dockerhub/src/app/Dockerfile#L39 (static) | - https://dev.tt-rss.org/fox/ttrss-docker-compose/src/branch/static-dockerhub/src/app/Dockerfile#L39 (static) | ||||||
| - https://dev.tt-rss.org/fox/ttrss-docker-compose/src/branch/master/app/Dockerfile#L28 (dynamic) | - https://dev.tt-rss.org/fox/ttrss-docker-compose/src/branch/master/app/Dockerfile#L28 (dynamic) | ||||||
| 
 | 
 | ||||||
| ### How do I customize the YML without commiting my changes to git? | ### How do I customize the YML without commiting my changes to git? | ||||||
| 
 | 
 | ||||||
| You can use [docker-compose.override.yml](https://docs.docker.com/compose/extends/). For example, customize `db` to use a different postgres image: | You can use [docker-compose.override.yml](https://docs.docker.com/compose/extends/). For example, customize `db` to use a different postgres image: | ||||||
| 
 | 
 | ||||||
| ```yml | ```yml | ||||||
| version: '3' | version: '3' | ||||||
| 
 | 
 | ||||||
| services: | services: | ||||||
|   db: |   db: | ||||||
|     image: postgres:13-alpine |     image: postgres:13-alpine | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| ### I'm trying to run CLI tt-rss scripts inside the container and they complain about root | ### I'm trying to run CLI tt-rss scripts inside the container and they complain about root | ||||||
| 
 | 
 | ||||||
| (run in the compose script directory) | (run in the compose script directory) | ||||||
| 
 | 
 | ||||||
| ```sh | ```sh | ||||||
| docker-compose exec --user app app php8 /var/www/html/tt-rss/update.php --help | docker-compose exec --user app app php8 /var/www/html/tt-rss/update.php --help | ||||||
| 
 | 
 | ||||||
| #                           ^   ^  | #                           ^   ^  | ||||||
| #                           |   |  | #                           |   |  | ||||||
| #                           |   +- service (container) name | #                           |   +- service (container) name | ||||||
| #                           +----- run as user | #                           +----- run as user | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| or | or | ||||||
| 
 | 
 | ||||||
| ```sh | ```sh | ||||||
| docker-compose exec app sudo -Eu app php8 /var/www/html/tt-rss/update.php --help | docker-compose exec app sudo -Eu app php8 /var/www/html/tt-rss/update.php --help | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| or | or | ||||||
| 
 | 
 | ||||||
| ```sh | ```sh | ||||||
| docker exec -it <container_id> sudo -Eu app php8 /var/www/html/tt-rss/update.php --help | docker exec -it <container_id> sudo -Eu app php8 /var/www/html/tt-rss/update.php --help | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| Note: `sudo -E` is needed to keep environment variables. | Note: `sudo -E` is needed to keep environment variables. | ||||||
| 
 | 
 | ||||||
| ### How do I add plugins and themes? | ### How do I add plugins and themes? | ||||||
| 
 | 
 | ||||||
| For official plugins, you can use plugin installer in `Preferences` → `Plugins`. | For official plugins, you can use plugin installer in `Preferences` → `Plugins`. | ||||||
| 
 | 
 | ||||||
| -------- | -------- | ||||||
| 
 | 
 | ||||||
| By default, tt-rss code is stored on a persistent docker volume (``app``). You can find | By default, tt-rss code is stored on a persistent docker volume (``app``). You can find | ||||||
| its location like this: | its location like this: | ||||||
| 
 | 
 | ||||||
| ```sh | ```sh | ||||||
| docker volume inspect ttrss-docker_app | grep Mountpoint | docker volume inspect ttrss-docker_app | grep Mountpoint | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| Alternatively, you can mount any host directory as ``/var/www/html`` by updating ``docker-compose.yml``, i.e.: | Alternatively, you can mount any host directory as ``/var/www/html`` by updating ``docker-compose.yml``, i.e.: | ||||||
| 
 | 
 | ||||||
| ```yml | ```yml | ||||||
| volumes: | volumes: | ||||||
|       - app:/var/www/html |       - app:/var/www/html | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| Replace with: | Replace with: | ||||||
| 
 | 
 | ||||||
| ```yml | ```yml | ||||||
| volumes: | volumes: | ||||||
|       - /opt/tt-rss:/var/www/html |       - /opt/tt-rss:/var/www/html | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| Copy and/or git clone any third party plugins into ``plugins.local`` as usual. | Copy and/or git clone any third party plugins into ``plugins.local`` as usual. | ||||||
| 
 | 
 | ||||||
| ### How do I use dynamic image for development? | ### How do I use dynamic image for development? | ||||||
| 
 | 
 | ||||||
| The idea is to map source code someplace more accessible than a docker volume. Example `docker-compose.override.yml`: | The idea is to map source code someplace more accessible than a docker volume. Example `docker-compose.override.yml`: | ||||||
| 
 | 
 | ||||||
| ```yml | ```yml | ||||||
| 
 | 
 | ||||||
| version: '3' | version: '3' | ||||||
| 
 | 
 | ||||||
| services: | services: | ||||||
|   app: |   app: | ||||||
|     build: |     build: | ||||||
|       context: |       context: | ||||||
|         ./app |         ./app | ||||||
|     volumes: |     volumes: | ||||||
|       - ./html:/var/www/html |       - ./html:/var/www/html | ||||||
|     env_file: |     env_file: | ||||||
|       - .env |       - .env | ||||||
| 
 | 
 | ||||||
|   updater: |   updater: | ||||||
|     build: |     build: | ||||||
|       context: |       context: | ||||||
|         ./app |         ./app | ||||||
|     volumes: |     volumes: | ||||||
|       - ./html:/var/www/html |       - ./html:/var/www/html | ||||||
|     env_file: |     env_file: | ||||||
|       - .env |       - .env | ||||||
| 
 | 
 | ||||||
|   web-nginx: |   web-nginx: | ||||||
|     build: ./web-nginx |     build: ./web-nginx | ||||||
|     volumes: |     volumes: | ||||||
|       - ./html:/var/www/html |       - ./html:/var/www/html | ||||||
|     env_file: |     env_file: | ||||||
|       - .env |       - .env | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| Then open `html/tt-rss` in your source code editor of choice. You can enable PHP debugging using `.env`: | Then open `html/tt-rss` in your source code editor of choice. You can enable PHP debugging using `.env`: | ||||||
| 
 | 
 | ||||||
| ```ini | ```ini | ||||||
| TTRSS_XDEBUG_ENABLED=yes | TTRSS_XDEBUG_ENABLED=yes | ||||||
| 
 | 
 | ||||||
| #TTRSS_XDEBUG_HOST= | #TTRSS_XDEBUG_HOST= | ||||||
| # defaults to host IP | # defaults to host IP | ||||||
| 
 | 
 | ||||||
| #TTRSS_XDEBUG_PORT=9000 | #TTRSS_XDEBUG_PORT=9000 | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| ### I'm running into 502 errors and/or other connectivity issues | ### I'm running into 502 errors and/or other connectivity issues | ||||||
| 
 | 
 | ||||||
| First, check that all containers are running: | First, check that all containers are running: | ||||||
| 
 | 
 | ||||||
| ``` | ``` | ||||||
| $ docker-compose ps | $ docker-compose ps | ||||||
|                    Name                                 Command               State           Ports |                    Name                                 Command               State           Ports | ||||||
| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ||||||
| ttrss-docker-demo_app_1_f49351cb24ed         /bin/sh -c /startup.sh           Up      9000/tcp | ttrss-docker-demo_app_1_f49351cb24ed         /bin/sh -c /startup.sh           Up      9000/tcp | ||||||
| ttrss-docker-demo_backups_1_8d2aa404e31a     /dcron.sh -f                     Up      9000/tcp | ttrss-docker-demo_backups_1_8d2aa404e31a     /dcron.sh -f                     Up      9000/tcp | ||||||
| ttrss-docker-demo_db_1_fc1a842fe245          docker-entrypoint.sh postgres    Up      5432/tcp | ttrss-docker-demo_db_1_fc1a842fe245          docker-entrypoint.sh postgres    Up      5432/tcp | ||||||
| ttrss-docker-demo_updater_1_b7fcc8f20419     /updater.sh                      Up      9000/tcp | ttrss-docker-demo_updater_1_b7fcc8f20419     /updater.sh                      Up      9000/tcp | ||||||
| ttrss-docker-demo_web-nginx_1_fcef07eb5c55   /docker-entrypoint.sh ngin ...   Up      127.0.0.1:8280->80/tcp | ttrss-docker-demo_web-nginx_1_fcef07eb5c55   /docker-entrypoint.sh ngin ...   Up      127.0.0.1:8280->80/tcp | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| Then, ensure that frontend (`web-nginx` or `web`) container is up and can contact FPM (`app`) container: | Then, ensure that frontend (`web-nginx` or `web`) container is up and can contact FPM (`app`) container: | ||||||
| 
 | 
 | ||||||
| ``` | ``` | ||||||
| $ docker-compose exec web-nginx ping app | $ docker-compose exec web-nginx ping app | ||||||
| PING app (172.18.0.3): 56 data bytes | PING app (172.18.0.3): 56 data bytes | ||||||
| 64 bytes from 172.18.0.3: seq=0 ttl=64 time=0.144 ms | 64 bytes from 172.18.0.3: seq=0 ttl=64 time=0.144 ms | ||||||
| 64 bytes from 172.18.0.3: seq=1 ttl=64 time=0.128 ms | 64 bytes from 172.18.0.3: seq=1 ttl=64 time=0.128 ms | ||||||
| 64 bytes from 172.18.0.3: seq=2 ttl=64 time=0.206 ms | 64 bytes from 172.18.0.3: seq=2 ttl=64 time=0.206 ms | ||||||
| ^C | ^C | ||||||
| --- app ping statistics --- | --- app ping statistics --- | ||||||
| 3 packets transmitted, 3 packets received, 0% packet loss | 3 packets transmitted, 3 packets received, 0% packet loss | ||||||
| round-trip min/avg/max = 0.128/0.159/0.206 ms | round-trip min/avg/max = 0.128/0.159/0.206 ms | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| Containers communicate via DNS names assigned by Docker based on service names defined in `docker-compose.yml`. This means that services (specifically, `app`) in the YML must not be renamed, and Docker DNS service should be functional. | Containers communicate via DNS names assigned by Docker based on service names defined in `docker-compose.yml`. This means that services (specifically, `app`) in the YML must not be renamed, and Docker DNS service should be functional. | ||||||
| 
 | 
 | ||||||
| Similar issues may be also caused by Docker `iptables` functionality either being disabled or conflicting with `nftables`. | Similar issues may be also caused by Docker `iptables` functionality either being disabled or conflicting with `nftables`. | ||||||
| 
 | 
 | ||||||
| ### How do I put this container behind a reverse proxy? | ### How do I put this container behind a reverse proxy? | ||||||
| 
 | 
 | ||||||
| A common pattern is shared nginx doing SSL termination, etc. Don't forget to pass `X-Forwarded-Proto` to the container if you're using HTTPS, otherwise tt-rss would generate plain HTTP URLs. | - Don't forget to pass `X-Forwarded-Proto` to the container if you're using HTTPS, otherwise tt-rss would generate plain HTTP URLs. | ||||||
| 
 | - You will need to set ``SELF_URL_PATH`` to a correct (i.e. visible from the outside) value in the ``.env`` file. | ||||||
| Address and port correspond to `HTTP_PORT` in `.env`, default:  | - Address and port correspond to `HTTP_PORT` in `.env`, default:  | ||||||
| 
 | 
 | ||||||
| ```ini | ```ini | ||||||
| HTTP_PORT=127.0.0.1:8280 | HTTP_PORT=127.0.0.1:8280 | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| ##### Nginx: | ##### Nginx: | ||||||
| 
 | 
 | ||||||
| ```nginx | ```nginx | ||||||
| location /tt-rss/ { | location /tt-rss/ { | ||||||
|     proxy_set_header Host $host; |     proxy_set_header Host $host; | ||||||
|     proxy_set_header X-Real-IP $remote_addr; |     proxy_set_header X-Real-IP $remote_addr; | ||||||
|     proxy_set_header X-Forwarded-For $remote_addr; |     proxy_set_header X-Forwarded-For $remote_addr; | ||||||
|     proxy_set_header X-Forwarded-Proto $scheme; |     proxy_set_header X-Forwarded-Proto $scheme; | ||||||
| 
 | 
 | ||||||
|     proxy_pass http://127.0.0.1:8280/tt-rss/; |     proxy_pass http://127.0.0.1:8280/tt-rss/; | ||||||
|     break; |     break; | ||||||
| } | } | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| If you run into problems with global PHP-to-FPM handler taking priority over proxied location, define tt-rss location like this so it takes higher priority: | If you run into problems with global PHP-to-FPM handler taking priority over proxied location, define tt-rss location like this so it takes higher priority: | ||||||
| 
 | 
 | ||||||
| ```nginx | ```nginx | ||||||
| location ^~ /tt-rss/ { | location ^~ /tt-rss/ { | ||||||
|    .... |    .... | ||||||
| } | } | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| If you want to pass an entire nginx virtual host to tt-rss: | If you want to pass an entire nginx virtual host to tt-rss: | ||||||
| 
 | 
 | ||||||
| ```nginx | ```nginx | ||||||
| server { | server { | ||||||
|    server_name rss.example.com; |    server_name rss.example.com; | ||||||
|     |     | ||||||
|    ... |    ... | ||||||
| 
 | 
 | ||||||
|    location / { |    location / { | ||||||
|       proxy_set_header Host $host; |       proxy_set_header Host $host; | ||||||
|       proxy_set_header X-Real-IP $remote_addr; |       proxy_set_header X-Real-IP $remote_addr; | ||||||
|       proxy_set_header X-Forwarded-For $remote_addr; |       proxy_set_header X-Forwarded-For $remote_addr; | ||||||
|       proxy_set_header X-Forwarded-Proto $scheme; |       proxy_set_header X-Forwarded-Proto $scheme; | ||||||
|        |        | ||||||
|       proxy_pass http://127.0.0.1:8280/; |       proxy_pass http://127.0.0.1:8280/; | ||||||
|       break; |       break; | ||||||
|    } |    } | ||||||
| } | } | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| Note that `proxy_pass` in this example points to container website root. | Note that `proxy_pass` in this example points to container website root. | ||||||
| 
 | 
 | ||||||
| ##### Apache (this assumes you're using HTTPS): | ##### Apache | ||||||
| 
 | 
 | ||||||
| ``` | ``` | ||||||
| a2enmod proxy | <IfModule mod_proxy.c> | ||||||
| a2enmod proxy_http |     <Location /tt-rss> | ||||||
| ``` |       ProxyPreserveHost On | ||||||
| 
 |       ProxyPass        http://localhost:8280/tt-rss | ||||||
| ```apache |       ProxyPassReverse http://localhost:8280/tt-rss | ||||||
| <VirtualHost *> |       RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME} | ||||||
|     ServerName domain.com |     </Location> | ||||||
| 
 |   </IfModule> | ||||||
|     ... | ``` | ||||||
| 
 | 
 | ||||||
|     ProxyPreserveHost On | ### I have internal web services tt-rss is complaining about (URL is invalid, loopback address, disallowed ports) | ||||||
|     ProxyRequests Off | 
 | ||||||
| 
 | Put your local services on the same docker network with tt-rss, then access them by service (= host) names, i.e. `http://rss-bridge/`. | ||||||
|     RequestHeader set X-Forwarded-Proto https | 
 | ||||||
| 
 | ```yml | ||||||
|     # Server IP + the exposed port of docker container  | services: | ||||||
|     ProxyPass / http://127.0.0.1:8280/ |    rss-bridge: | ||||||
|     ProxyPassReverse / http://127.0.0.1:8280/ | .... | ||||||
| </VirtualHost> | networks: | ||||||
| ``` |   default: | ||||||
| 
 |     external: | ||||||
| You will need to set ``SELF_URL_PATH`` to a correct (i.e. visible from the outside) value in the ``.env`` file. |       name: ttrss-docker_default | ||||||
| 
 | ```       | ||||||
| ### I have internal web services tt-rss is complaining about (URL is invalid, loopback address, disallowed ports) |        | ||||||
| 
 | If your service uses a non-standard (i.e. not 80 or 443) port, make an internal reverse proxy sidecar container for it. | ||||||
| Put your local services on the same docker network with tt-rss, then access them by service (= host) names, i.e. `http://rss-bridge/`. | 
 | ||||||
| 
 | See also: | ||||||
| ```yml | 
 | ||||||
| services: | - https://community.tt-rss.org/t/heads-up-several-vulnerabilities-fixed/3799/ | ||||||
|    rss-bridge: | - https://community.tt-rss.org/t/got-specified-url-seems-to-be-invalid-when-subscribing-to-an-internal-rss-feed/4024 | ||||||
| .... | 
 | ||||||
| networks: | ### Backup and restore | ||||||
|   default: | 
 | ||||||
|     external: | If you have `backups` container enabled, stock configuration makes automatic backups (database, local plugins, etc.) once a week to a separate storage volume. | ||||||
|       name: ttrss-docker_default | 
 | ||||||
| ```       | Note that this container is included as a safety net for people who wouldn't bother with backups otherwise. If you value your data, you should invest your time into setting up something like [WAL-G](https://github.com/wal-g/wal-g) instead. | ||||||
|        | 
 | ||||||
| If your service uses a non-standard (i.e. not 80 or 443) port, make an internal reverse proxy sidecar container for it. | ------------------------- | ||||||
| 
 | 
 | ||||||
| See also: | A process to restore the database from such backup would look like this: | ||||||
| 
 | 
 | ||||||
| - https://community.tt-rss.org/t/heads-up-several-vulnerabilities-fixed/3799/ | 1. Enter `backups` container shell: `docker-compose exec backups /bin/sh` | ||||||
| - https://community.tt-rss.org/t/got-specified-url-seems-to-be-invalid-when-subscribing-to-an-internal-rss-feed/4024 | 2. Inside the container, locate and choose the backup file: `ls -t /backups/*.sql.gz` | ||||||
| 
 | 3. Clear database (**THIS WOULD DELETE EVERYTHING IN THE DB**): `psql -h db -U $TTRSS_DB_USER $TTRSS_DB_NAME -e -c "drop schema public cascade; create schema public"` | ||||||
| ### Backup and restore | 3. Restore the backup: `zcat /backups/ttrss-backup-yyyymmdd.sql.gz | psql -h db -U $TTRSS_DB_USER $TTRSS_DB_NAME` | ||||||
| 
 | 
 | ||||||
| If you have `backups` container enabled, stock configuration makes automatic backups (database, local plugins, etc.) once a week to a separate storage volume. | Alternatively, if you want to initiate backups from the host, you can use something like this: | ||||||
| 
 | 
 | ||||||
| Note that this container is included as a safety net for people who wouldn't bother with backups otherwise. If you value your data, you should invest your time into setting up something like [WAL-G](https://github.com/wal-g/wal-g) instead. | ```sh | ||||||
| 
 | source .env | ||||||
| ------------------------- | docker-compose exec db /bin/bash \ | ||||||
| 
 |   -c "export PGPASSWORD=$TTRSS_DB_PASS \ | ||||||
| A process to restore the database from such backup would look like this: |   && pg_dump -U $TTRSS_DB_USER $TTRSS_DB_NAME" \ | ||||||
| 
 |   | gzip -9 > backup.sql.gz | ||||||
| 1. Enter `backups` container shell: `docker-compose exec backups /bin/sh` | ``` | ||||||
| 2. Inside the container, locate and choose the backup file: `ls -t /backups/*.sql.gz` | 
 | ||||||
| 3. Clear database (**THIS WOULD DELETE EVERYTHING IN THE DB**): `psql -h db -U $TTRSS_DB_USER $TTRSS_DB_NAME -e -c "drop schema public cascade; create schema public"` | ([source](https://community.tt-rss.org/t/docker-compose-tt-rss/2894/233?u=fox)) | ||||||
| 3. Restore the backup: `zcat /backups/ttrss-backup-yyyymmdd.sql.gz | psql -h db -U $TTRSS_DB_USER $TTRSS_DB_NAME` | 
 | ||||||
| 
 | ### How do I use custom certificates? | ||||||
| Alternatively, if you want to initiate backups from the host, you can use something like this: | 
 | ||||||
| 
 | You need to mount custom certificates into the *app* and *updater* containers like this: | ||||||
| ```sh | 
 | ||||||
| source .env | ```yml | ||||||
| docker-compose exec db /bin/bash \ | volumes: | ||||||
|   -c "export PGPASSWORD=$TTRSS_DB_PASS \ |     .... | ||||||
|   && pg_dump -U $TTRSS_DB_USER $TTRSS_DB_NAME" \ |     ./ca1.crt:/usr/local/share/ca-certificates/ca1.crt:ro | ||||||
|   | gzip -9 > backup.sql.gz |     ./ca2.crt:/usr/local/share/ca-certificates/ca2.crt:ro | ||||||
| ``` |     .... | ||||||
| 
 | ``` | ||||||
| ([source](https://community.tt-rss.org/t/docker-compose-tt-rss/2894/233?u=fox)) | 
 | ||||||
| 
 | Don't forget to restart the containers. | ||||||
| ### How do I use custom certificates? | 
 | ||||||
| 
 | See also: https://community.tt-rss.org/t/60-ssl-certificate-problem-unable-to-get-local-issuer-certificate/4838/4?u=fox | ||||||
| You need to mount custom certificates into the *app* and *updater* containers like this: | 
 | ||||||
| 
 | ### How do I make this work on Raspberry Pi? | ||||||
| ```yml | 
 | ||||||
| volumes: | You won't be able to use official Docker Hub images, those are amd64 only. Use dynamic setup (master branch of this repository) instead. | ||||||
|     .... |  | ||||||
|     ./ca1.crt:/usr/local/share/ca-certificates/ca1.crt:ro |  | ||||||
|     ./ca2.crt:/usr/local/share/ca-certificates/ca2.crt:ro |  | ||||||
|     .... |  | ||||||
| ``` |  | ||||||
| 
 |  | ||||||
| Don't forget to restart the containers. |  | ||||||
| 
 |  | ||||||
| See also: https://community.tt-rss.org/t/60-ssl-certificate-problem-unable-to-get-local-issuer-certificate/4838/4?u=fox |  | ||||||
| 
 |  | ||||||
| ### How do I make this work on Raspberry Pi? |  | ||||||
| 
 |  | ||||||
| You won't be able to use official Docker Hub images, those are amd64 only. Use dynamic setup (master branch of this repository) instead. |  | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue