instrumentisto / coturn-docker-image

[Closed] Coturn TURN server Docker image
Other
191 stars 47 forks source link

Docker-Compose for Nextcloud #7

Closed bf8392 closed 5 years ago

bf8392 commented 5 years ago

Can you provide a working docker-compose file and configuration that works for the nextcloud talk plugin? with tls enabled please...I can't get this working..works fine with coturn installed on host, but not in docker.

tyranron commented 5 years ago

@bd8392 we've never used NextCloud talk plugin, so barely we can help you with that.

However, you can provide here your Docker Compose specs you've done already and we can help you to find out what is wrong.

bf8392 commented 5 years ago

There is an Issue with specifying the config file... Mounting own config under /etc/coturn/turnserver.conf does not work...It only works with the command option specifying the location of the config file, but when the turnserver restarts, the command is ignored. Also ther is no way provided to specify the commands directly in docker compose...That was the problem why it was not working with nextcloud...here my working docker-compose (till the service restarts)

coturn: container_name: coturn image: instrumentisto/coturn restart: unless-stopped depends_on:

tyranron commented 5 years ago

@bd8392

Mounting own config under /etc/coturn/turnserver.conf does not work

Why? It works for us pretty well.

bf8392 commented 5 years ago

I don't know... tried it multiple times...

bf8392 commented 5 years ago

Could you find the reason why it's maybe not working for me?

lurkker commented 5 years ago

I had the same problem.

The Dockerfile in this repo has the following command line:

CMD ["-n", "--log-file=stdout", "--external-ip=$(detect-external-ip)"]

In the coturn wiki it says:

-n Do not use configuration file, use only command line parameters.

To override the Dockerfile's command in your docker-compose.yml just use:

coturn:
    image: instrumentisto/coturn
    command: turnserver

command: turnserver allows the turnserver to read the config in /etc/coturn/turnserver.conf but does not have the log-file and external-ip flags therefore you will also have to set these in your turnserver.conf:

log-file=stdout
external-ip=0.0.0.0

Replace 0.0.0.0 with your turn server's public ip address.

weltmaister commented 4 years ago

Hi, in

CMD ["-n", "--log-file=stdout", "--external-ip=$(detect-external-ip)"]

the "-n" flag is necessary? AFAIU, with it, an individual turnserver.conf could never work or how does it? Or how can I solve this when needing "--external-ip=$(detect-external-ip)" for nonstatic IP via DynDNS? Tried already the Dockerfile with setting everything as command line parameters:

CMD ["-n", "--log-file=stdout", "--external-ip=$(detect-external-ip)", "--listening-port=3478", "--lt-cred-mech", "--use-auth-secret", "static-auth-secret=xxxxxxxx", "--realm=xxx.xxxx.xx", "--total-quota=100", "--bps-capacity=0", "--stale-nonce", "--no-loopback-peers", "--no-multicast-peers"]

didn´t work neither as

CMD ["-c=/etc/coturn/turnserver.conf", "--log-file=stdout", "--external-ip=$(detect-external-ip)"]

both produce same result in log:

standard_init_linux.go:211: exec user process caused "no such file or directory"

sorry for reopening

tyranron commented 4 years ago

@weltmaister

the "-n" flag is necessary?

No it's not. It's added by default as Docker image has no config file inside. You're free to override container args to match your use case.

Or how can I solve this when needing "--external-ip=$(detect-external-ip)" for nonstatic IP via DynDNS?

You can mix config file and container args. For example:

services:
  coturn:
    container_name: myproj-coturn
    image: instrumentisto/coturn:4.5
    command:
      - --log-file=stdout
      - --external-ip=$$(detect-external-ip)  # <- notice $$ to omit Docker Compose expansion
      #- --Verbose
    volumes:
      - ./_dev/coturn/turnserver.conf:/etc/coturn/turnserver.conf:ro
      - ./.cache/coturn/data:/var/lib/coturn
    network_mode: host
SuperSandro2000 commented 4 years ago

notice $$ to omit Docker Compose expansion

which is wrong. It still gets expanded to one $.

weltmaister commented 4 years ago

@tyranron

services:
  coturn:
    image: instrumentisto/coturn:latest
    command:
      - -c=/etc/coturn/turnserver.conf
      - --log-file=stdout
      - --external-ip=$$(detect-external-ip)
    volumes:
      - ./_dev/coturn/turnserver.conf:/etc/coturn/turnserver.conf:ro
    network_mode: host

with '- -c=/etc/coturn/turnserver.conf' and '$$' works for me.

`...

with '$' didn´t. Thanks a lot.

PS: Should be there a hint in the README.md, that a volume-linked turnserver.conf always has to be in conjunction with the "- -c=" command option?