Skip to content

When using postgres and configuring socks5 proxy, the database will be disconnected #196

@hobin66

Description

@hobin66

When using the bridge container to access each other, the postgres container name will also be proxied by socks5, resulting in failure to resolve the postgres container IP, resulting in disconnection. The following is my compose file。

services:
suwayomi_server:
image: ghcr.io/suwayomi/suwayomi-server:v2.1.1960
container_name: Suwayomi-Server
depends_on:
- suwayomi-server-db
environment:
# 数据库配置
- DATABASE_TYPE=POSTGRESQL
#In this case, the socks5 proxy cannot be used because although the container can connect to the database after the initial startup, the IP cannot be resolved when the socks5 proxy takes effect, which will cause suwayomi to be unable to connect to the database. I hope to fix it as soon as possible.
#-----------------------------------------------------
- DATABASE_URL=postgresql://suwayomi-server-db:5432/suwayomi
#--------------------------------------------------------
#这种情况无法使用socks5代理,因为当容器初次启动后虽然能连接到数据库,但是当之后socks5代理生效就无法解析IP了,会导致suwayomi无法连接数据库,希望尽快修复。
- DATABASE_USERNAME=suwayomi
- DATABASE_PASSWORD=6spTJd54eziGGaQP

  # 其他可选配置
  - TZ=Asia/Shanghai
  - BIND_PORT=4567
  - WEB_UI_ENABLED=true
volumes:
  - ./files:/home/suwayomi/.local/share/Tachidesk
  - ./files/downloads/thumbnails:/home/suwayomi/.local/share/Tachidesk/downloads/thumbnails
  - /vol1/openlist/123云盘/备份同步/suwayomi-server/mangas:/home/suwayomi/.local/share/Tachidesk/downloads/mangas
ports:
  - "4568:4567"
restart: unless-stopped
networks:
  - fnos-network

suwayomi-server-db:
container_name: suwayomi-server-db
image: postgres:17.6
restart: always
environment:
- POSTGRES_USER=suwayomi
- POSTGRES_PASSWORD=6spTJd54eziGGaQP
- POSTGRES_DB=suwayomi
- PGDATA=/var/lib/postgresql/data
- TZ=Asia/Shanghai
- PGTZ=Asia/Shanghai
volumes:
- ./postgres/data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -h suwayomi-server-db -p 5432 -U suwayomi"]
start_period: 30s
interval: 10s
retries: 5
timeout: 5s
networks:
- fnos-network

networks:
fnos-network:
external: true

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions