paullouisageneau / violet

Lightweight STUN/TURN server
GNU General Public License v2.0
225 stars 23 forks source link

Docker image #13

Closed holtwick closed 2 years ago

holtwick commented 2 years ago

This project is super awesome. I would like to offer it as a coturn alternative for people that like to install my Open Source tool https://github.com/holtwick/briefing/

Did you consider bundling it for Docker via https://hub.docker.com ? I think this would make it very attractive for regular users.

paullouisageneau commented 2 years ago

Thank you for your interest in the project. Your open source tool Briefing looks pretty nice!

FYI a Dockerfile has been added in https://github.com/paullouisageneau/violet/pull/14. I'll push an image to Docker Hub.

holtwick commented 2 years ago

Thanks. I'll try to get it to work with Briefing and give users introductions how to use it as a STUN/TURN server for it. Once it is working it will be such a nice lightweight setup :)

paullouisageneau commented 2 years ago

I pushed an image on Docker Hub: paullouisageneau/violet

holtwick commented 1 year ago

@paullouisageneau finally I found the time to play around with the docker image.

It seems to work. I made some modifications, that might be useful for the project:

In Dockerfile I changed the last line to load a config file. Environment variables are not supported, right?

CMD [ "/usr/local/bin/violet", "--file=/etc/violet/violet.conf" ]

I then created a config file like this

# Log level
log-level=info

# Log file (default stdout)
log=/etc/violet/violet.log

# Port for STUN/TURN server
port=3478

# Port range for TURN relay
range=49152:49252

# Local address to bind (default any)
# bind=0.0.0.0

# External address to advertise for TURN relay (default automatic)
external=49.12.100.3

# TURN credentials with optional quota (default none)
credentials=brie:fi
quota=50 

# Global maximum number of allocations
#max=1024

Notice, I limited the relay ports.

The in a docker-compose.yml I used this:

version: "3"

services:
  violet:
    container_name: violet
    # build: .
    image: paullouisageneau/violet
    restart: unless-stopped    
    ports:
    - "3478:3478"
    - "3478:3478/udp"
    - "49152-49252:49152-49252"
    - "49152-49252:49152-49252/udp"
    volumes:
    - ./data:/etc/violet

Commenting out image: and activatingbuild: . would allow to do local builds like: docker-compose build.

I'm not sure about UDP or not. Probably this all could even become shorter. I took inspirations from here https://github.com/coturn/coturn/blob/master/docker/docker-compose-all.yml#L64

luckman212 commented 6 months ago

@holtwick or @paullouisageneau are there any current instructions anywhere for setting up the Docker image? I'd like to try it but it's a bit unclear! Thank you

paullouisageneau commented 5 months ago

@luckman212 I've added some instructions to the README file.

luckman212 commented 5 months ago

@paullouisageneau Looks good! I am away for a few days but I plan to try this next week. 🙏