-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
Summary
When deploying apps that download files from external HTTPS URLs from a worker/background process (e.g. Sidekiq downloading WhatsApp media from Meta’s lookaside.fbsbx.com), the download can fail with Connection reset by peer when running inside the default Docker bridge network, while the same request from the host succeeds. This happens on some VPS providers (e.g. Hostinger KVM) and is a known Docker/network behaviour (NAT, IPv6, routing), not an application bug.
Workaround that works: run the affected service (e.g. the worker) with network_mode: host. That requires:
- Exposing Redis/DB on host ports (e.g.
6389:6379,5433:5432) - Setting that service’s env vars to use
127.0.0.1and those ports - Removing
networks:for that service (incompatible with host mode)
Right now this means manually editing the generated docker-compose.yml in the server. Those edits are lost on next deploy because Coolify regenerates the compose.
Suggestion
-
Documentation: Add a short note in the docs (e.g. “Troubleshooting” or “Docker Compose”) explaining that for apps needing stable outbound HTTPS to certain CDNs from a container, bridge network can fail on some hosts, and that using
network_mode: hostfor the affected service (with Redis/DB on host ports) is a valid workaround. -
Optional – UI: For Docker Compose deployments, consider a per-service option like “Network mode: host” so users can enable it without editing the file, and Coolify can regenerate the compose while preserving that setting (and optionally the needed port mappings / env overrides).
This would help anyone deploying Chatwoot (WhatsApp media), or any similar app that downloads from external URLs inside a worker container.
Context
- Reported in: Chatwoot side: WhatsApp Cloud media download fails in Docker (Connection reset by peer) – workaround: host network for Sidekiq chatwoot/chatwoot#13612
- Observed: Coolify-deployed Chatwoot (Docker Compose), Sidekiq in bridge network; media download fails. Same stack with Sidekiq on
network_mode: host(Redis/Postgres on host ports) works.