HenryQW / Awesome-TTRSS

🐋 Awesome TTRSS, a powerful Dockerised all-in-one RSS solution.
http://ttrss.henry.wang
MIT License
2.4k stars 499 forks source link

[BUG] Docker Traefik Server Operation timed out. #441

Open wwxiaoqi opened 1 year ago

wwxiaoqi commented 1 year ago

Bug 描述

在使用 Docker Compose 配合 Traefik Server 搭建 Tiny RSS 时出现 Operation timed out.

部署方法

部署环境

复现步骤

  1. 安装 Traefik Server
    
    version: '3.7'

networks: default: name: traefik-proxy external: true

services: traefik: image: traefik:v2.9 container_name: traefik-proxy restart: unless-stopped ports:

networks: default: name: traefik-proxy external: true

services:

Mercury 全文抓取

rss-mercury: image: wangqiru/mercury-parser-api:latest container_name: rss-mercury restart: always

OpenCC 简体、繁体中文转换

rss-opencc: image: wangqiru/opencc-api-server:latest container_name: rss-opencc environment:

你谷歌/百度了吗?

我参考了以下内容尝试解决这个问题:

防火墙问题

114 #313 #226 #62 根据这些 issues,我尝试添加了如以下内容:

--- diff1.yml   2023-02-17 12:37:41.250909198 +0800
+++ diff2.yml   2023-02-17 12:40:05.917580850 +0800
@@ -4,18 +4,28 @@
   default:
     name: traefik-proxy
     external: true
+  public_access:
+  service_only:
+    internal: true
+  database_only:
+    internal: true

 services:
   # Mercury 全文抓取
   rss-mercury:
     image: wangqiru/mercury-parser-api:latest
     container_name: rss-mercury
+    networks:
+      - public_access
+      - service_only
     restart: always

   # OpenCC 简体、繁体中文转换
   rss-opencc:
     image: wangqiru/opencc-api-server:latest
     container_name: rss-opencc
+    networks:
+      - service_only
     environment:
       - NODE_ENV=production
     restart: always
@@ -24,6 +34,8 @@
   rss-postgres:
     image: postgres:13-alpine
     container_name: rss-postgres
+    networks:
+      - database_only
     restart: always
     environment:
       - POSTGRES_USER=rss
@@ -38,10 +50,16 @@
     restart: always
     container_name: rss
     tty: true
+    networks:
+      - public_access
+      - service_only
+      - database_only
     environment:
       - SELF_URL_PATH=https://rss.funcc.cc/
       - DB_USER=rss
       - DB_PASS=POSTGRES_PASSWORD
+      - PUID=1000
+      - PGID=1000
     volumes:
       - ./rss_data/feed-icons:/var/www/feed-icons/
     labels:

预期结果

Docker 中的 Tiny Tiny RSS 本体经过 Traefik Server 后可正常访问 rss.funcc.cc

错误日志

rss-postgres  | PostgreSQL Database directory appears to contain a database; Skipping initialization
rss-postgres  |
rss-postgres  | 2023-02-17 04:47:27.197 UTC [1] LOG:  starting PostgreSQL 13.10 on x86_64-pc-linux-musl, compiled by gcc (Alpine 12.2.1_git20220924-r4) 12.2.1 20220924, 64-bit
rss-postgres  | 2023-02-17 04:47:27.197 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
rss-postgres  | 2023-02-17 04:47:27.197 UTC [1] LOG:  listening on IPv6 address "::", port 5432
rss-postgres  | 2023-02-17 04:47:27.202 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
rss-postgres  | 2023-02-17 04:47:27.207 UTC [23] LOG:  database system was shut down at 2023-02-17 03:38:43 UTC
rss-postgres  | 2023-02-17 04:47:27.218 UTC [1] LOG:  database system is ready to accept connections
rss-opencc    |
rss-opencc    | > opencc.henry.wang@0.0.0 start /usr/src/app
rss-opencc    | > node ./bin/www
rss-opencc    |
rss-mercury   |
rss-mercury   | > mercury-parser-api@1.0.0 start /app
rss-mercury   | > node index.js
rss-mercury   |
rss-mercury   | 🚀Mercury Parser API listens on port 3000
rss           | Operation timed out
rss           | Operation timed out
rss           | Operation timed out
rss           | Operation timed out
rss           | Operation timed out
rss exited with code 0

其他 待添加...