For the application start, several conditions must be met:
- If the application will be launched locally, then aspnetcore 3.1 runtime must be installed
- There must be a reverse proxy to establish an https connection (optional you can use free cloudflare balancer with https)
- If you have to scale service, you need:
- Redis (version >=6 with acl user who can create/pub/sub channels with prefix
peermeeting
) - Load balancer with sticky sessions (From version 1.3.0, sticky sessions not needed)
- Redis (version >=6 with acl user who can create/pub/sub channels with prefix
- If you want to enable participants to connect to the conference using a symmetric NAT, then you will need to deploy the
COTURN
TURN server. (Example of settings in swarm.yml)
Next, you need to choose a launch method. It is possible to launch the application:
- Run the executable file locally
- Run in docker
- Using docker compose
- Using docker swarm
For configuring you need add environment variable.
Available configurations:
Serilog:MinimumLevel:Default
- configuring logger minimum levelRedis:Enabled
- (defaultfalse
) enable/disable redis connection. Need for scale serviceRedis:ConnectionString
- connection string to redis. (example:localhost,user=serviceuser,password=VeryHardPass,channelPrefix=peermeeting
)Metrics:Enabled
- (defaultfalse
) enable/disable collecting metrics and prometheus endpoint (/api/metrics
)Mertics:Endpoint
- (default/api/metrics
) path to prometheus metrics endpointMetrics:BasicAuth
- (defaultfalse
) enable/disable basic authorization on prometheus endpointMetrics:Username
- username for basic authorizeMetrics:Password
- password for basic authorizeCoturn:Enabled
- (default false) enable/disable TURN connection credentials expose. Need for participants with symmetric NATCoturn:TurnAddress
- Turn server ip and port. (example:8.8.8.8:3478
)Coturn:SharedSecret
- Shared secret key with coturn server to generate temporary password.
For configuring you need to make changes to appsettings.Production.json
. The list of settings is identical to that described in the "Configure container" block.
For an example of launching via docker compose, a compose file has been prepared with a description of starting the service and nginx with a self-signed certificate for quick launch (For test use only).
In this example, nginx proxies traffic to the application over the internal network. To use an external proxy, you just need to expose the application to the outside by adding the port ports:"30005:80"
to the compose file. An example of a proxying configuration for nginx is here.
Compose file:
version: '3.8'
services:
peer-meeting:
image: eluki/peer-meeting
nginx:
image: nginx:latest
volumes:
- ./nginx/conf.d:/etc/nginx/conf.d
- ./nginx/ssl:/etc/nginx/ssl
ports:
- "80:80"
- "443:443"
To run the application, you need to run:
docker-compose up
You can use the prepared swarm.yml to run in Docker Swarm. The configuration does not use nginx because it is preferable to use an external proxy to create an https connection. Also starting and configure coturn (TURN) server.
version: '3.8'
services:
host:
image: eluki/peer-meeting
environment:
- "Coturn:Enabled=true"
- "Coturn:TurnAddress=[coturnIP]:3478"
- "Coturn:SharedSecret=VerySecretSharedKey"
ports:
- target: 80
published: 30005
protocol: tcp
mode: host
deploy:
replicas: 1
update_config:
parallelism: 1
delay: 10s
order: stop-first
placement:
max_replicas_per_node: 1
logging:
driver: "json-file"
options:
max-size: "3m"
max-file: "3"
coturn:
image: coturn/coturn
command:
- "-n"
- "--log-file=stdout"
- "--listening-port=3478"
- "--min-port=49160"
- "--max-port=49200"
- "--external-ip='$(detect-external-ip)'"
- "--realm='$(hostname)'"
- "--use-auth-secret"
- "--static-auth-secret=VerySecretSharedKey"
- "--no-tls"
- "--no-tcp"
networks:
- outside
deploy:
replicas: 1
logging:
driver: "json-file"
options:
max-size: "3m"
max-file: "3"
networks:
outside:
external: true
name: "host"
To deploy the application, you need to run:
docker stack deploy -c swarm.yml peer-meeting