Files
livekit/deploy/cloud-init.amzn2.yaml
2022-01-21 14:28:03 -08:00

44 lines
1.2 KiB
YAML

#cloud-config
repo_update: true
repo_upgrade: all
packages:
- docker
bootcmd:
- mkdir /opt/livekit-server/ssl
write_files:
- path: /opt/livekit-server/config.yaml
content: |
log_level: info
port: 7880
rtc:
use_external_ip: true
tcp_port: 7881
udp_port: 7882
keys:
APIkey: secret
- path: /opt/livekit-server/ssl/server.crt
content: |
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
- path: /opt/livekit-server/ssl/server.key
content: |
-----BEGIN PRIVATE KEY----
...
-----END PRIVATE KEY-----
runcmd:
- export LIVEKIT_VERSION=v0.15 # set LiveKit version
- curl -o /etc/systemd/system/docker.livekit-server@.service -O https://raw.githubusercontent.com/livekit/master/cloud-images/deploy/docker.livekit-server%40.service
- systemctl enable docker
- systemctl start docker
- systemctl enable docker.livekit-server@${LIVEKIT_VERSION}
- systemctl start docker.livekit-server@${LIVEKIT_VERSION}
- amazon-linux-extras install -y nginx1
- curl -o /etc/nginx/conf.d/livekit.conf -O https://raw.githubusercontent.com/livekit/livekit-server/master/deploy/livekit.nginx.conf
- systemctl enable nginx
- systemctl start nginx