From f71bec27e5f8b3c9a8bbcb1be0ee48a2191dfa61 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Feb 2026 00:27:46 +0000 Subject: [PATCH] Fix coturn crash: image runs as nobody, can't create pidfile The coturn/coturn:latest image sets USER nobody:nogroup. On startup, turnserver tries to create /var/run/turnserver.pid which nobody can't write to, causing an immediate crash (the 2.2s "Error" in compose). Fix: add user: root to the coturn service. Since we already use network_mode: host, the container has broad host access anyway. Also adds DETECT_EXTERNAL_IP=yes which is the image's native way to auto-detect and set --external-ip, replacing our shell script. https://claude.ai/code/session_01Vm6NLaQuzM4VosAotqS1q8 --- docker-compose.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index b909494..cfeea95 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -82,8 +82,12 @@ services: image: coturn/coturn:latest container_name: easy-asterisk-coturn network_mode: host - # Uses the image's native docker-entrypoint.sh (no shell override) - # which prepends 'turnserver' when first arg starts with '-' + # The coturn image runs as nobody:nogroup by default, which cannot + # create /var/run/turnserver.pid. Run as root to avoid this. + user: root + environment: + # Image-native external IP detection (adds --external-ip automatically) + - DETECT_EXTERNAL_IP=${DETECT_EXTERNAL_IP:-yes} command: - -n - --listening-port=3478