-
Notifications
You must be signed in to change notification settings - Fork 6
/
container-linux.yaml
65 lines (56 loc) · 2.4 KB
/
container-linux.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
---
systemd:
units:
- name: etcd-member.service
enabled: true
dropins:
- name: conf1.conf
contents: |
[Service]
Environment="ETCD_NAME=av1"
Environment="ETCD_ADVERTISE_CLIENT_URLS=http://127.0.0.1:2379"
Environment="ETCD_INITIAL_ADVERTISE_PEER_URLS=http://127.0.0.1:2380"
Environment="ETCD_LISTEN_CLIENT_URLS=http://127.0.0.1:2379,http://172.17.0.1:2379"
Environment="ETCD_LISTEN_PEER_URLS=http://127.0.0.1:2380"
Environment="ETCD_INITIAL_CLUSTER=av1=http://127.0.0.1:2380"
- name: locksmithd.service
mask: true
- name: update-engine.service
mask: true
- name: docker.service
enabled: true
- name: systemd-networkd-wait-online.service
enabled: true
- name: nginx-rtmp.service
enabled: true
contents: |
[Unit]
Description=NGINX RTMP Server
Wants=docker.service
After=docker.service
# Wait for network to become ready
Wants=systemd-networkd-wait-online.service
After=systemd-networkd-wait-online.service
[Service]
# Set COREOS_PUBLIC_IPV4
EnvironmentFile=/etc/environment
# Allow time for Docker to download image
TimeoutStartSec=0
# Restart on failure
RestartSec=10
Restart=on-failure
# Remove old containers if required
ExecStartPre=-/usr/bin/docker kill nginx-rtmp
ExecStartPre=-/usr/bin/docker rm nginx-rtmp
# Pull image first if needed
ExecStartPre=/usr/bin/docker pull awakening/awakening-nginx-rtmp:2019-04-28
# Setup initial configuration
ExecStartPre=/usr/bin/etcdctl set /live/secret ${publish_secret}
ExecStartPre=/usr/bin/etcdctl set /live/encodings/1 145:48:416x234
ExecStartPre=/usr/bin/etcdctl set /live/encodings/2 365:48:640x360
ExecStartPre=/usr/bin/etcdctl set /live/encodings/3 730:128:768x432
ExecStartPre=/usr/bin/etcdctl set /live/encodings/4 1100:128:768x432
ExecStartPre=/usr/bin/etcdctl set /live/encodings/5 2000:128:1080x720
# Run bound to our IPv4 address, set DNS to Google Public DNS
ExecStart=/usr/bin/docker run --name nginx-rtmp --add-host="etcd:172.17.0.1" -e ETCD_URL=http://etcd:2379 -p 80:80 -p 1935:1935 --dns 8.8.8.8 --dns 8.8.4.4 awakening/awakening-nginx-rtmp:2019-04-28
ExecStop=/usr/bin/docker stop nginx-rtmp