本文共计3234字,预计需要花费 5分钟才能阅读完成。
部署方法:docker-compose
Docker-Compose 代码
version: "3"
services:
service.rss:
image: wangqiru/ttrss:latest
container_name: ttrss
ports:
- 181:80
environment:
- SELF_URL_PATH=https://xxx.xxx.xxx/ # please change to your own domain
- DB_PASS=xxxxxxxxx # use the same password defined in
- PUID=1000
- PGID=1000
- ALLOW-PORTS=1200
volumes:
- feed-icons:/var/www/feed-icons/
networks:
- public_access
- service_only
- database_only
stdin_open: true
tty: true
restart: always
service.mercury: # set Mercury Parser API endpoint to
image: wangqiru/mercury-parser-api:latest
container_name: mercury
networks:
- public_access
- service_only
restart: always
database.postgres:
image: postgres:13-alpine
container_name: postgres
environment:
- POSTGRES_PASSWORD=xxxxxxxxxxxx # feel free to change the password
volumes:
- ~/postgres/data/:/var/lib/postgresql/data # persist postgres data to ~/postgres/data/ on the host
networks:
- database_only
restart: always
# utility.watchtower:
# container_name: watchtower
# image: containrrr/watchtower:latest
# volumes:
# - /var/run/docker.sock:/var/run/docker.sock
# environment:
# - WATCHTOWER_CLEANUP=true
# - WATCHTOWER_POLL_INTERVAL=86400
# restart: always
volumes:
feed-icons:
networks:
public_access: # Provide the access for ttrss UI
service_only: # Provide the communication network between services only
internal: true
database_only: # Provide the communication between ttrss and database only
internal: true
services:
service.rss:
image: wangqiru/ttrss:latest
container_name: ttrss
ports:
- 181:80
environment:
- SELF_URL_PATH=https://xxx.xxx.xxx/ # please change to your own domain
- DB_PASS=xxxxxxxxx # use the same password defined in
database.postgres- PUID=1000
- PGID=1000
- ALLOW-PORTS=1200
volumes:
- feed-icons:/var/www/feed-icons/
networks:
- public_access
- service_only
- database_only
stdin_open: true
tty: true
restart: always
service.mercury: # set Mercury Parser API endpoint to
service.mercury:3000 on TTRSS plugin setting pageimage: wangqiru/mercury-parser-api:latest
container_name: mercury
networks:
- public_access
- service_only
restart: always
database.postgres:
image: postgres:13-alpine
container_name: postgres
environment:
- POSTGRES_PASSWORD=xxxxxxxxxxxx # feel free to change the password
volumes:
- ~/postgres/data/:/var/lib/postgresql/data # persist postgres data to ~/postgres/data/ on the host
networks:
- database_only
restart: always
# utility.watchtower:
# container_name: watchtower
# image: containrrr/watchtower:latest
# volumes:
# - /var/run/docker.sock:/var/run/docker.sock
# environment:
# - WATCHTOWER_CLEANUP=true
# - WATCHTOWER_POLL_INTERVAL=86400
# restart: always
volumes:
feed-icons:
networks:
public_access: # Provide the access for ttrss UI
service_only: # Provide the communication network between services only
internal: true
database_only: # Provide the communication between ttrss and database only
internal: true
其中的xxx.xxx.xxx需要替换
下面的代码是nginx的配置,aapanel面板可以直接换成下面的配置:
# nginx.conf
upstream ttrssdev {
server 127.0.0.1:181;
}
server {
listen 80;
server_name xxxx.xxxx.xxxx;
return 301 https://xxxx.xxxx.xxxx$request_uri;
}
server {
listen 443 ssl;
gzip on;
server_name xxxx.xxxx.xxxx;
ssl_certificate /www/server/panel/vhost/cert/xxxx.xxxx.xxxx/fullchain.pem;
ssl_certificate_key /www/server/panel/vhost/cert/xxxx.xxxx.xxxx/privkey.pem;
location / {
proxy_redirect off;
proxy_pass http://ttrssdev;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Frame-Options SAMEORIGIN;
client_max_body_size 100m;
client_body_buffer_size 128k;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
}
}还需要填写一个反向代理:

支持的环境变量列表
SELF_URL_PATH: TTRSS 实例地址。? 请注意,该变量值必须与你在浏览器中用于访问 TTRSS 的 URL 保持完全一致,否则 TTRSS 将无法启动。
DB_HOST: 数据库地址
DB_PORT: 数据库端口
DB_NAME: 数据库名字
DB_USER: 数据库用户名
DB_PASS: 数据库密码
DB_USER_FILE: Docker Secrets 支持(替代 DB_USE),包含数据库用户名的文件
DB_PASS_FILE: Docker Secrets 支持(替代 DB_PASS),包含数据库密码的文件
ENABLE_PLUGINS: 全局启用的插件名称,其中
auth_internal 为必须启用的登录插件ALLOW_PORTS: 逗号分隔端口号,如
1200,3000。允许订阅非 80,443 端口的源。? 谨慎使用。SESSION_COOKIE_LIFETIME: 使用网页版登陆时 cookie 过期时间,单位为小时,默认为
24 小时HTTP_PROXY:
ip:port, TTRSS 实例的全局代理,为源地址添加单独代理请使用 Options per FeedDISABLE_USER_IN_DAYS: 当用户 X 天后没有登录后,停止为其自动更新订阅源,直至用户再次登陆
FEED_LOG_QUIET: true 禁用订阅源更新所产生的日志打印
正文完