Fix coturn container/volume separation: use COTURN_CONTAINER for container_name and map COTURN_VOLUME to /var/lib/coturn

Details:
- Removed anonoumys volume
- Renamed container_name variable to COTURN_CONTAINER
- Added dedicated COTURN_VOLUME with _data suffix for persistence
- Mount COTURN_VOLUME into /var/lib/coturn

Reference: https://chatgpt.com/share/68da6f12-b238-800f-932b-e37c8a50dddd
This commit is contained in:
2025-09-29 13:36:30 +02:00
parent aa19a97ed6
commit 55f2d15e93
2 changed files with 4 additions and 2 deletions

View File

@@ -3,7 +3,7 @@
coturn:
{% include 'roles/docker-container/templates/base.yml.j2' %}
image: {{ COTURN_IMAGE }}:{{ COTURN_VERSION }}
container_name: {{ COTURN_VOLUME }}
container_name: {{ COTURN_CONTAINER }}
network_mode: {{ COTURN_NETWORK_MODE }}
{% if COTURN_NETWORK_MODE == 'bridge' %}
ports:
@@ -16,6 +16,7 @@
volumes:
- "{{ COTURN_TLS_CERT_PATH }}:{{ COTURN_TLS_CERT_PATH }}:ro"
- "{{ COTURN_TLS_KEY_PATH }}:{{ COTURN_TLS_KEY_PATH }}:ro"
- "{{ COTURN_VOLUME }}:/var/lib/coturn"
command: >
{% if COTURN_USER_AUTH_ENABLED | bool %}
--lt-cred-mech

View File

@@ -8,7 +8,8 @@ domain: "{{ domains | get_domain(application_id) }}"
## Docker
COTURN_VERSION: "{{ applications | get_app_conf(application_id, 'docker.services.' ~ entity_name ~ '.version') }}"
COTURN_IMAGE: "{{ applications | get_app_conf(application_id, 'docker.services.' ~ entity_name ~ '.image') }}"
COTURN_VOLUME: "{{ entity_name }}"
COTURN_VOLUME: "{{ entity_name }}_data"
COTURN_CONTAINER: "{{ entity_name }}"
COTURN_REALM: "{{ domain }}"
COTURN_NETWORK_MODE: "{{ applications | get_app_conf(application_id, 'docker.services.' ~ entity_name ~ '.network_mode') }}"